PDA

View Full Version : Need help with simple If statement


capsize
04-28-2005, 03:58 PM
Hi.

I have the following code:


/* Frame1 */
_root.TF = _level3._totalframes;
_root.FL = _level3._framesloaded;
_root.CF = _level3._currentframe;

if (_root.CF == _root.TF) {
_root.gotoAndStop(2);
}

/* Frame2 */

gotoAndPlay(1);



this is the code from an emptyMC on the root stage called "timer".

I am loading an .swf into _level3, and this code is supposed to control movement on the _root timeline.

Im looking to move the _root timeline to the nextFrame, when the movie loaded in _level3 has its _currentFrame "equal" to the total number of frames in the loading movie in _level3 (which would be the last frame of the loaded .swf).

My AS doesnt seem to be doing the trick.

Any help is appreciated!

Thanks!

shotsy247
04-28-2005, 04:28 PM
What is it you want this to do?

Right now you are telling your script to gotoAndStop on frame 2. When it gets there it is told to gotoAndPlay frame 1, which then tells it to gotoAndStop on frame 2, which tells it to gotoAndPlay frame 1... you have an endless loop there.

Try telling your script to gotoAndStop on frame 3 once the movie has finished loading.

_t

capsize
04-28-2005, 04:35 PM
i keep answering my own questions!



_root.TF = Math.round(_level3._totalframes);
_root.FL = Math.round(_level3._framesloaded);
_root.CF = Math.round(_level3._currentframe);

if (_root.CF == _root.TF) {
_root.gotoAndStop(2);
}


thanks!