I have a MC on my stage. It has let’s say a motion tween that covers the stage when you click on a button. At the end of this motion tween we have a loadMovie (it loads a external swf). Then after that we have another motion tween that reveals the stage this time (showing the new swf)
My problem is that I don’t want the animation in the swf to start until the motion tween that reveals the stage is complete.
so what i did was at the end of the motion tween that reveals the stage i put
_global.myFlag=3;
then in the first frame the of movie being loaded i put
stop();
if (myFlag==3) {
blah blah ...
}
this does not work … anyone know of a different way or why this is not working?
Put it on the first frame of the movie being loaded. Your way it’s only checking once, mine keeps on checking till it’s true (at least that is what it should do, i didn’t test it)
I have a preloader script on the first frame of the movie being loaded … so what i did using your script was
this.onEnterFrame = function() {
//checks to see if the external movie (this) is fully loaded
if (this.getBytesLoaded()<this.getBytesTotal()) {
Total = this.getBytesTotal()/1000;
Received = this.getBytesLoaded()/1000;
_root.cover.loader.percentage = (Received/Total)*100;
//tell the progress bar animation (located in the cover mc)
//to go to a frame between 0 and 100
_root.cover.loader.bar._xscale = percentage;
} else {
//when its fully loaded
m = _parent.createEmptyMovieClip("temp", 1000);
m.onEnterFrame = function(){
if(_global.myFlag==3) {
gotoAndPlay(2);
delete this.onEnterFrame;
}
}
//tell the cover mc to play its opening animation
_root.cover.gotoAndPlay("show_mc");
//turn of the enterFrame action
this.onEnterFrame = null;
}
};
stop();
This worked BUT if i click on a different button and then click on the button that loads this same swf again then the animation starts without waiting for the motion tween to finish.
I don’t know if this helps but it’s not exactly a motion tween revealilng the stage. I have a MC that is being attached and then duplicated to cover the stage area. Then in this MC it has a motion tween that reveals part of the stage (at the end of this motion tween i have “_global.myFlag=3;”
I see, it doesn’t work the second time, because myFlag is set to 3. So after you run it the first time you have to reset myFlag. Try:[AS] m = _parent.createEmptyMovieClip(“temp”, 1000);
m.onEnterFrame = function(){
if(_global.myFlag==3) {
gotoAndPlay(2);
_global.myFlag = null;
delete this.onEnterFrame;
}[/AS]
that seems logical but it did not work … when i click on anothr button and then come back to this one it starts to play before the revealing animation is done … ummmmm
Voetsoeba
I didn’t get what you meant by “only to write them”