-
Loading an array from PHP to flash.
Could someone please help me, I am loading an array into SWF using sendAndLoad. So I was wondering how to access the array. Mayeb this should be in Noobies cause I sure feel like one.
so I load it in this way
Code:
sendData = new loadVars();
sendData.id = "blah blah";
sendData.onLoad = function (success) {
if (success) {
trace(sendData);
}else{
trace("Error dummy head!");
}
sendData.sendAndLoad("http://",sendData,"POST");
}
So how do I see the array now? The name of the Array is 'totaldates'
Last edited by Andrue; 05-06-2003 at 04:37 PM.
-
Danny Gomez Creations ®
Re: Loading an array from PHP to flash.
Originally posted by Andrue
resultLoadVars=new LoadVars();
sendData.sendAndLoad("http:// <--file.php goes here",resultLoadVars goes here);
resultLoadVars.onLoad=function(succes....
flash takes name value pairs just like when you whant to transmit data from a php file to another you go link.php?name=value1&name=value2
but instead of having it at the end of a link you print it out on the screen, thats what flash gets. I dunno about php but in jsp its:
out.print("name=value") and in asp its: response.write(name=value), u know, the way you do when you want to display html within php.
So if you whant to send an array, I suggest that you send a xml formatted string as one value. In flash you parse it to xml and loop throu the thing. Im supposing its a database resultset and you dont know how many of each it will hold, thats why I think that xml is the way to go. You can even set up a function for making a 2d array of the xml formatted resultset data and feed the datagrid component with it!
Last edited by cosmiceye; 05-06-2003 at 07:09 PM.
-
Moved to the backend forum.
psx
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|