[Webpro] importing arrays into flash
Rebecca Wyatt
rebecca at bellafly.com
Mon Apr 19 05:23:09 EDT 2004
I thought about this - is there a way to create an actionscript on the fly with PHP, though?
Rebecca
On Mon, 19 Apr 2004 13:55:16 +0530, Vinod V. V wrote:
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/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://six.pairlist.net/pipermail/webpro/attachments/20040419/20869e90/attachment.htm
More information about the Webpro
mailing list