dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: i got all the files in a dir into an array with php? how do i send it to flash?

  1. #1
    Member
    Join Date
    Feb 2002
    Posts
    52

    i got all the files in a dir into an array with php? how do i send it to flash?

    i put it all into an array w/ a script. how do i send it to flash in a format flash can read as an array?

  2. #2
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, CA (USA)
    Posts
    4,361
    you'll have to send them individually as single variables in url encoded format

  3. #3
    Member
    Join Date
    Feb 2002
    Posts
    52
    heres the thing, i dont know how to make 'dynamic variables'

    in flash u would use eval('something')

    what would i do in php?

    for($i=0; $<(btw, how do u get the length of an array in php); $i++){
    create var here = array[$i]
    }

  4. #4
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    Hi,

    you can take an array in PHP (assuming it is numerically indexed) an send it's values to flash like this,

    PHP Code:
    $output '&';
    for (
    $i 0$i count($arrayName); ++$i) {
        
    $output .= "nameForVariableInFlash$i=" urlencode($arrayName[$i]) . '&';
    }
    echo 
    $output
    this (when loaded by flash) will create the variables nameForVariableInFlash0, nameForVariableInFlash1 etc in your movie.

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