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


Last articles

Erreur de Sécurité Flash Pla... Montage PC : Ventirad COOLER... Automatiser vos META avec le... Utiliser l'opacité d'un masq... Utiliser des expressions rég... Premiers pas en Objective-C... Bug Gestion des balises META... Quelle version de PHP pour J... Afficher un Plane Papervisio... ExpressJS Server...


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