Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need movie to wait for dynamic variables to load

Status
Not open for further replies.

mattfarley

IS-IT--Management
Dec 11, 2002
25
US
I need to use the results of dynamic variables to choose whether or not a movie plays. The problem is, it takes about 3-5 seconds for the variables to load from our database, and by then Flash is already done loading.

So I need it to

Start
Wait for dynamic variables to load
then continue processing whether or not movies play

I tried some OnClipEvent(data) stuff, but it didn't seen to work :(

My code it Frame 1 of Layer 1 is:
loadVariablesNum(" 0, "POST");

And my code in the movie instance is:
onClipEvent (data) {
stop();
this.swapdepths(0);
myvar = _root.daddy;
if (myvar == "415"){
this.nextFrame();
}
}
'daddy' is a dynamic variable loaded from the traps.asp (it's just a test)

Thanks for any help!
 
if you are using mx then change to loadvars

if you are using 5 and your code suggest that then place an empty dynamic text box well of stage in frame 1 and give it the variable name daddy

add this to the frame 1 actions

if(daddy==undefined){
gotoAndPlay(2)
}else{
//what you want when the var is loaded
}

frame 2

gotoAndPlay(1);



_______________________________________
You know you're old if you can remember when bacon, eggs and sunshine were good for you
 
_lv new LoadVars();
_lv.onLoad = function(){
myvar = _lv.daddy;
//whatever else you want on data loaded
)
_lv.load("

all on actions for frame 1

ill download your fla if you cant get it work now.

_______________________________________
You know you're old if you can remember when bacon, eggs and sunshine were good for you
 
Maybe something's wrong with my MX? It's giving me this on run:

Scene=Scene 1, Layer=FrontMap, Frame=1: Line 1: ';' expected
_lv new LoadVars();

Scene=Scene 1, Layer=FrontMap, Frame=1: Line 8: Unexpected ')' encountered
)
 
download the corrected file and use that



_______________________________________
You know you're old if you can remember when bacon, eggs and sunshine were good for you
 
Perfect! Now how can I get the 415 to appear as the dynamic text? I tried setting the dynamic text box to

daddy
_parent.daddy
_root.daddy

doesnt seem to work

any ideas?
 
Nevermind :)

_lv.daddy

Thanks again for all your help, you've saved me a ton of time!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top