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

Accès à la propriété stage e... Focus et ScrollPane - Problè... utf8 : substr ou mb_substr... Node.js Introduction et Inst... Automatiser vos META avec le... Contrôler un SWF externe - E... Lecteur MP3 - SylPlayer... Afficher les Polices référen... Module Fade Rotator pour Joo... Soumission d’une Application...


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