geek space web solutions

Send array from Flash / As3 to a PHP file

Tuesday, 20 July 2010 12:16
The development of Flash requires regular use of external files as php, asp or of the coldfusion to perform functions such as sending e-mail or inserting data into a database ...

That is my method for passing arrays to a php file named flash_pele_mele.php.
I still said that this type of transfer variable is of course possible only for variables of type String, Number and int ...

Code AS3 side (look especially variable urlv) :
var postForm:URLRequest = new URLRequest("flash_pele_mele.php");
var urlv:URLVariables=new URLVariables();

var arraySourcesImagesLoaded:Array = new Array();

// We fill the array

urlv["urlSrcImg[]"] = arraySourcesImagesLoaded; = urlv;
postForm.method = URLRequestMethod.POST;

var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, processComplete);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, processError);
loader.addEventListener(IOErrorEvent.IO_ERROR, processError);

function processComplete(e:Event):void{


function processError(e:*):void{


Code PHP side :
for($k=0; $k<sizeof($_POST["urlSrcImg"]); $k++) {

$arraySrcImg[$k] = imagecreatefromjpeg($_POST["urlSrcImg"][$k]);



# Guest 2010-11-17 14:33
Thanks ! I was just looking for it.
Reply | Reply with quote | Quote

Add comment

Security code


fisting porn

Last articles

Installer le driver USB pour... Qu'est-ce que StageVideo ?... Component 'Classic Contact F... Lecteur MP3 - SylPlayer... ExpressJS Server... Utiliser la Squeezebox de Jo... Premiers pas en Objective-C... Scythe Mugen 2 Cooler test... Activer le mode galerie de S... AS2 : Customiser une ComboBo...


Do you think HTML5 can completely replace Flash ?
Would you be interested in an online XML editor ?



Code du plugin Joomla AutoSEO 1.2 par