I am trying to get data from a MySQL database into Flash. In flash, I have
[AS]
loadVariables(ânews.phpâ,âcontentâ);
[/AS]
on the first frame of the main movie where content is the movieclip the variables should be loaded into. Inside content, I have a dynamic text field with the var âinhoudâ. On the left of that dynamic textfield, there is an empty movieclip called âimgâ, in which an image should load. So on that movieclip I have
Now when I tested the movie, it didnât work. So I viewed the php file, and this HUGE list comes up, which just grows longer and longer. It almost overloads my computer. What do I have to do to prevent this ?
because you are telling the loop to print out the string output every time the loop executes and the loop gets bigger and bigger with each loop. thats why it prints out so much info.
Well basically ⌠only the text That would be âdatumâ and âinhoudâ. The image that should be loaded is âhomeâ+i+".jpg", where i = $nrows. So that basically means that if I create another row (with other content), it goes to home2.jpg, and so on.
Now that I think about it, the â<**br><**br>â I have there is totally useless, as the PHP is only defining vars for Flash, and not filling in the vars in Flash ⌠and the âimgâ column is useless too âŚ
not necessarily. I think its just because he is storing all the data inside that string and then telling the loop to print out that string with each loop. You donât realyl want that. You want to add all the data to the loop and then once the loop is finished print out the data.
No it still doesnât work. The PHP file now generates the whole loop, and is then supposed to write that whole bunch, but I didnât wait for that :P. Can I fix the loop somehow ?
*Originally posted by Jubba *
**not necessarily. I think its just because he is storing all the data inside that string and then telling the loop to print out that string with each loop. You donât realyl want that. You want to add all the data to the loop and then once the loop is finished print out the data. **
you have to wait for the loop to finish executing and then print out the data as one long string so Flash can read it. Use the code that I gave you in one of my previous posts.
and the link is http://voetsjoeba.xszone.nl/test/news.php. Right now it does nothing, cuz itâs still in that loop, and keeps generating data and thus doesnât print anything (I guess, cuz I ainât waiting for it )