-
Php use to fill an array in flash . URGENT !
Hello
I am trying to fill an array in flash with PHP, but i get no results stored. When though I send a value in a flash variable with a php script, everything works ok.
I have at frame one 2 comnands, one to define the array and one to get the script going with a loaavars command.
The php print command that i use with the while loop has this form:
n++;
print("&id_array[$n]".vadiable1);
where n increases each time the loop is executed.
The result is that i get an epty array in flash.
What i am doing wrong ?
Thanks
Stratos
Lightform - Evolution One
http://lightform.onar.gr
Ex - Reactor 5.0
-
Hi,
you wouldn't believe it - you are not setting array elements in flash but rather variables named id_array[0] - varnames with square brackets in them
Since you will need to use some actions anyway to recover these, you had better use
id_array=value1|value2|value3
or
id_array1=value1&id_array2=value2&id_array3=value3 &count=3
In any case you need to wait for the data before you can act upon them
frame 1: load vars
frame 2: no code
frame 3: if a particular variable, (id_array, id_array1, count depending on which way you use) is not set, go to frame 2
frame 4: build array from the data
Musicman
-
Xmmm
I does notmake sence though.
Here's why
I have this data structure
news_id - News_Date - News_text
Lets say i have 30 news that i would like to show.
So i must create 90 variables, and use these variables to fill the arrays id_array - date_array - news_array ?
On the other hand, is it possible to fill an array from a text file or the same solution applies there as well ? ( for each value i use a variable and then use the produced variables to fill the arrays ?)
Thank for the immidiate responce
Stratos
Lightform - Evolution One
http://lightform.onar.gr
Ex - Reactor 5.0
-
Hi,
unfortunately this is the case...
And, to make things worse, if you use F5 or at least expect a certain percentage of viewers using the F5 player, you had better check whether joining the data with a delimiter character and splitting again works for all your viewers - it likes to generate "your computer is slow" messages
Musicman
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|