PDA

View Full Version : Going to a frame from checking external variable


smumdax
06-04-2001, 04:48 PM
Here's my simple, yet raging, problem.
I have a .txt file that contains the following:

&theframe=10

In my FLA, I have the following script on the first frame:

loadVariablesNum ("test.txt", 0);

And then, on the second frame, I have another ActionScript that is SUPPOSE to check the variable and sending me to the correspondong frame. BUT... DO NOT WORK!!!
Here's what I have:

if (theframe==5) {
gotoAndStop (5);
} else if (theframe==10) {
gotoAndStop (10);
} else {
stop ();
}
SO? Please tell me what is wrong with it before my little icon on the side goes to red...

Marx
06-04-2001, 05:22 PM
Hi...
You may need to give your variables more time to load.
Its worth placing your checking loop in an onClipEvent so you can constantly check to see if the condition has been met:

onClipEvent (enterFrame) {
if (_root.theframe == 5) {
_root.gotoAndStop(5);
} else if (_root.theframe == 10) {
_root.gotoAndStop(10);
}
}

You could still use your previous code as long as you place a 'go to and play' action that loops back to your check.

Hope this helps.