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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stopping a clip until a variable becomes true 1

Status
Not open for further replies.

EricAndresen0

Programmer
Jul 30, 2003
15
0
0
US
Does anyone know of a way to get a movie clip to pause until a global variable becomes true (triggered by a button or event in another clip)? Currently, I am using a messy system that involves two keyframes with the same contents that appears stopped but is actually playing in a loop back and forth to continue checking the variable status. Is there a simpler way to do this?

Here is an example of my code. This will wait for the variable _global.blnThreeA to be true until it goes to the third frame:

On the first frame:

if (_global.blnThreeA == true) {
this.gotoandplay(3)
}


On the second frame:

if (_global.blnThreeA == true) {
this.gotoandplay(3)
} else {
this.gotoandplay(1)
}


Does anyone have a suggestion about a better way to do this?
 
without knowing the specifics this ought to do it

stop();
this.onEnterFrame = function(){
if(_global.blnThreeA)gotoAndPlay(3)
}
 
Thanks. That is working great and is saving me a lot of grief. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top