SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Mar 2002
    Location
    New York, NY
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    arrays from php to flash

    could anyone give me a basic idea of how you would take a stored array in php and then load it into flash (ver. 6, i'm using MX)?

    thanks in advance

    zing

  2. #2
    SitePoint Member
    Join Date
    Feb 2003
    Location
    mars
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by zing
    could anyone give me a basic idea of how you would take a stored array in php and then load it into flash (ver. 6, i'm using MX)?

    thanks in advance

    zing
    print array from php in this form (script must be pure PHP, no HTML tags):
    &somevariablename=value1§value2§value3......
    (§ sign is used as a delimiter because later you will need to explode that string)

    in flash:
    temp = new LoadVars();
    temp.load(http://URL to PHP script);
    temp.onLoad = function(){
    myArray = new Array();
    myArray = temp.somevariablename.split("§");
    }

    and then you can access values in myArray in this form myArray[number]

  3. #3
    SitePoint Zealot
    Join Date
    Mar 2002
    Location
    New York, NY
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thats what i had thought... i just had wondered if there was any simpler way..

    thanks anyway

  4. #4
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by zing
    thats what i had thought... i just had wondered if there was any simpler way..

    thanks anyway

    Use Flash Remoting

    http://amfphp.sourceforge.net

    It will ocnvert PHP data types to Flash data types. Other than that what leom suggested is the easiest way.


Bookmarks

Posting Permissions

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