phpfreakjav Posted May 29, 2009 Share Posted May 29, 2009 How do I send a FLASH array into PHP?PLEASE LOOK AT THE CODE. I have indicated which arrays I want to send to php. mouseMC._visible = false; var recording = false; var playing = false; var index = 0; var mPosX = new Array(); var mPosY = new Array(); _root.onEnterFrame = function() { if(recording) { mPosX[index] = _root._xmouse; mPosY[index] = _root._ymouse; index++ } else if (playing) { mouseMC._x = mPosX[index] <<<<I WANT TO SEND THIS ARRAY TO PHP mouseMC._y = mPosY[index] <<<<I WANT TO SEND THIS ARRAY TO PHP index++; if(index == mPosX.length) { Mouse.show(); _root.mouseMC._visible = false; } } } recBtn.onRelease = function() { Mouse.show(); _root.mouseMC._visible = false; _root.recording = true; _root.playing = false; _root.index = 0; _root.mPosX = new Array(); _root.mPosY = new Array(); } playBtn.onRelease = function() { Mouse.hide(); _root.mouseMC._visible = true; _root.recording = false; _root.playing = true; _root.index = 0; } stopBtn.onRelease = function() { Mouse.show(); _root.mouseMC._visible = false; _root.recording = false; _root.playing = false; _root.index = 0; } Link to comment https://forums.phpfreaks.com/topic/160207-flash-array-to-php-array/ Share on other sites More sharing options...
.josh Posted May 29, 2009 Share Posted May 29, 2009 This isn't really a php question... as far as php receiving the values, it would receive it via GET or POST method. <?php echo "<pre>"; print_r($_GET); // dump all values in GET array print_r($_POST); // dump all values in POST array ?> So your question is how to get flash to send it via GET or POST. Which makes it a flash question. Thread moved. Link to comment https://forums.phpfreaks.com/topic/160207-flash-array-to-php-array/#findComment-845340 Share on other sites More sharing options...
DarkSuperHero Posted May 30, 2009 Share Posted May 30, 2009 You will probably need to serialize the array, heres a code example /* You will need to import the following import flash.net.URLLoader; import flash.net.URLRequest; import flash.net.URLRequestMethod; import flash.net.URLVariables; */ public function URLVariablesExample() { var url:String = "http://www.[yourDomain].com/application.php"; var request:URLRequest = new URLRequest(url); //request to send data to request.method = URLRequestMethod.POST; //using POST var variables:URLVariables = new URLVariables(); //stores your variable variables.exampleSessionId = "IDNumber" //exampleSessionId will be the key in your $_POST array variables.exampleUserLabel = "guest";//exampleUserLabel will be the key in your $_POST array //you can make up any new property you need in the variables object. request.data = variables; var loadPHPPage = new URLLoader() loadPHPPage.load(request); //probably add an even listener to know when its finished processing...or to do something upon a response from php //you can also use sentToURL() } cheers! Link to comment https://forums.phpfreaks.com/topic/160207-flash-array-to-php-array/#findComment-845860 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.