I am very new to Actionscript andhave been looking for a way
to load data from a php/mysql source into flash upon clicking
buttons in my flash movie. I have created this method below and i
simply would like to know if this is the/a correct way of doing it
or is there a simpler way?
1) I have X number of keyframes in my movie.
2) Have X number of navigation buttons in my movie which each
move the timeline to an associated keyframe on(Release)
3) On each keyframe I have the following code (but the ?id= i
pass to the php page is different depending on the keyframes,
therefore retrieving different data each time:
var reply_lv = new LoadVars();
var send_lv = new LoadVars();
I'm not really following why you need to have X keyframes.
And I don't see a stop here or a nextFrame(), so what is
controlling the position of the playhead? (In other words there is
so more stuff in that on (release), right?)
Also, you seem to be redefining the LoadVars() objects each
frame. I don't know, but to me that might get confusing.
Finally, if you are using on (release) you seem to be using a
mix of old style coding an new style with the LoadVars and all.
Here is maybe what I would do.
Have only one frame, with the button and the text fields,
etc. Then put this code on the FRAME itself.
curID=1; \\ or whatever it starts at.
var reply_lv=new LoadVars();
var send_lv=new LoadVars();
Or something like that. I'm not quite clear if the info is
sent automatically at each new "frame" or only on user interaction
Even if you do need different keyframe for the art/info on
screen/etc. I would still only have the two LoadVars and the
associated event handlers defined once. And I would only define the
button once as well. This will save you from having to go into X
different frames and make changes should something need it.