[Webpro] importing arrays into flash

Vinod V. V vinod at clasticon.com
Mon Apr 19 04:25:16 EDT 2004


Hi rebecca:
can you rewrite this file as an "newscript.as" file, and then use 
#include "newscript.as" so that the array will be directly read by flash,
you as file need to look like this
----------------

foo1= new Array(25,311,9062912,100,100,100,0,'foo',32);

foo2=new Array(26,311,9062912,100,100,100,0,'foo',33);
trace(foo1 + "  " + foo2);

-------------
I beleive it should only display numbers with a ","
regards
Rebecca Wyatt wrote:

> Hello,
>
>  
>
> I'm importing a variable into Flash (using PHP) that consists of a 
> list of arrays. How do I tell Flash that this 'variable' is actually a 
> bunch of arrays? I tried looping through them using PHP before they 
> get imported to Flash, but for some reason the arrays get quotes but 
> around them (like any other variable I import)... 
>
>  
>
> Example PHP (before import): 
>
>  
>
> $myOriginalVariable="foo1=new 
> Array(25,311,9062912,100,100,100,0,'foo',32);foo2=new 
> Array(26,311,9062912,100,100,100,0,'foo',33)";"
>
>  
>
> $myArray=explode("\r\n", $myOriginalVariable);
>
> foreach($myArray as $thisArray){
>
> print "&$thisArray";
>
> }
>
>  
>
> This code prints out something like this in Flash...
>
>  
>
> foo1="new Array(25,311,9062912,100,100,100,0,'foo',32)";
>
> foo2="new Array(26,311,9062912,100,100,100,0,'foo',33)";
>
>  
>
> ...which wouldn't be a problem except for the quotes (I think). 
> There's got to be another way...
>
>  
>
> Thanks in advance for your help!!
>
>  
>
> Rebecca
>
>------------------------------------------------------------------------
>
>------------------------------------------------------------------
>send message to the list:           mailto:list at webdesign-list.com
>[WebPro] list info, subscribe, archive: http://webdesign-list.com/
>There's also a FlashPro mailing list:       http://flash-list.com/
>muinar webdesign schweiz:             http://webdesign-schweiz.ch/
>





More information about the Webpro mailing list