dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Loading an array from PHP to flash.

  1. #1
    Senior Member
    Join Date
    Apr 2001
    Posts
    109

    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.

  2. #2
    Danny Gomez Creations cosmiceye's Avatar
    Join Date
    Mar 2002
    Location
    under a palmtree in Jamaica waiting for psytopia 2005 to begin
    Posts
    982

    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.
    ..:: P S Y T O P I A 2 0 0 5 :::..
    . . . view the psytopia reels _____RIVEND REEL | GOMEZ REEL_____ . . . . . . . . . . .

  3. #3
    psx = new Moderator();
    Join Date
    Jan 2001
    Posts
    923
    Moved to the backend forum.

    psx

  4. #4
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    Hi,

    find some information here:
    http://www.fontimages.org.uk/flash/struc.html

    Musicman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center