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

embedFonts et styleSheet - I... Cibler un élément DOM d'aprè... Lancer une application au dé... Résoudre l'erreur : "Error i... Construire un nouveau projet... Effacer un dossier : Message... Retirer Mootools du Front of... position:absolute with ie6 d... Scythe Mugen 2 Cooler test... MassLoader et LoaderMax - Gé...


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