Trying to get effect of a "when" type statement

Hello all,

I’m trying to form a statement that, in effect, is a when statement. I have made a movie clip that fades in and out. As it is rolled over it fades in, and when you roll out, it fades out - no problem scripting that with if statements: if _currentframe == Frame Number.

But the issue I’m having is that if you mouse over it and then out quickly, it will interrupt the fade in and automatically goto the fade out frame. I want to have a statement that says if you mouse out “WHEN the fade in is complete (or when it hits frame number whatever), THEN gotoAndPlay fadeout frame” even if the mouse is off the clip.

I’d appreciate any help!

Thanks,
Keith

Here is the code I’m using. I have 4 movie clips that all reside within a parent movie clip. The 4 clips all have this code on them (with necessary name changes of course).

If the mouse moves over them slowly and allows the tweens time to complete, it works beautifully. However, any rapid mouse movement will throw it out of whack.

on (rollOver) {
if (this._currentframe != _root.Start){
this.gotoAndPlay(“fadeIn”);
}
if (_parent.mc_2d._currentframe == _root.Start){
_parent.mc_2d.gotoAndPlay(“fadeOut”);
} else {
_parent.mc_2d.gotoAndStop(“OutState”);
}
if (_parent.mc_web._currentframe == _root.Start){
_parent.mc_web.gotoAndPlay(“fadeOut”);
} else {
_parent.mc_web.gotoAndStop(“OutState”);
}
if (_parent.mc_contact._currentframe == _root.Start){
_parent.mc_contact.gotoAndPlay(“fadeOut”);
} else {
_parent.mc_contact.gotoAndStop(“OutState”);
}
}

on (rollOut) {
if (this._currentframe != _root.Start){
this.gotoAndPlay(“fadeIn”);
} else {
_parent.mc_2d.gotoAndPlay(“fadeIn”);
_parent.mc_web.gotoAndPlay(“fadeIn”);
_parent.mc_contact.gotoAndPlay(“fadeIn”);
}
}

I originally had this code on the 4 clips:

on (rollOver) {
if (this._currentframe != 1){
this.gotoAndPlay(“fadeIn”);
}
if (_parent.mc_3d._currentframe == 1){
_parent.mc_3d.gotoAndPlay(“fadeOut”);
}
if (_parent.mc_web._currentframe == 1){
_parent.mc_web.gotoAndPlay(“fadeOut”);
}
if (_parent.mc_contact._currentframe == 1){
_parent.mc_contact.gotoAndPlay(“fadeOut”);
}
}

on (rollOut) {
this.gotoAndPlay(“fadeOut”);
}

which works exactly like I want it too, however, I can’t figure out a way to “reset” (goto frame 1) the 4 clips when the main movie clip is rolled off without affecting the way the 4 clips function.

[edit] _root.Start is simply a variable for frame 1