[Webpro] importing arrays into flash
Vinod V. V
vinod at clasticon.com
Mon Apr 19 05:31:50 EDT 2004
hi rebecca:
I don't know PHP but I have a sample php script which should help
----------------
<?php
$userCode = $HTTP_POST_VARS['myCode'];
$userName = $HTTP_POST_VARS['myName'];
$userDob = $HTTP_POST_VARS['myDob'];
$userAge = $HTTP_POST_VARS['myAge'];
$userGender = $HTTP_POST_VARS['mySex'];
$userScore = $HTTP_POST_VARS['userScore'];
$timeTaken = $HTTP_POST_VARS['timeSpent'];
$f=fopen("newscript.as", "a");
fwrite($f,
"$userCode\t$userName\t$userGender\t$userDob\t$userAge\t$userScore\t$timeTaken\r");
fclose($f);
?>
-------------
HTH
Rebecca Wyatt wrote:
> 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< br
> />>[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/
>>
>
>
>
>
>------------------------------------------------------------------------
>
>------------------------------------------------------------------
>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