How to Hide several Movie Clips on EnterFrame (or onEnterFrame SwapDepth) AS2 CS3

Hi Guys,

I am new to AS2, so any hints would be appreciated. The movie I am doing uses Kirupa’s rollover tutorial to roll an effect off a movie clip. As there are several of these on the page, I am also using swapdepth to put them on the top of the other clips when we are hovering over them. Otherwise the layer order messes things up.

The test file can be seen at www.greetingsfrombayer.com/new.

The (butchered) mc code is as follows:


stop();

this.onEnterFrame = function(){
if(rewind == true){ //if rewind switch is set to true play backwards
prevFrame(); // play backwards
}
}

this.onRollOver = function(){
rewind = false; //set variable (or switch) that decides wether ot not to play backwards…
play(); // play this movie clip… (grow the button(tween));
_root.x +=2; // this moved the movie clip to the top, to get out of the way of the others
this.swapDepths(_root.x);
}

this.onRollOut = function(){
rewind = true; //set or rewind switch to true so it will play backwards…
_root.x -= 3; // puts it back down onto it’s level again
this.swapDepths(_root.x);
}

this.onRelease = function(){
getURL(“http://www.animalhealth.bayerhealthcare.com”,"_blank");
}


The issue is that I have a closing image that comes on about a minute into the animation. (The movie pauses on frame 1 for 60 secs then moves on) But if a user is still hovering over one off the movie clips it keeps that movie clip on top, over the animation, which of course looks stupid.

So I either need to have an onEnterFrame (or alternative) that will delete all of the little movie clip rollovers, or will bring the final large movie clip to the top when it starts, whatever the user is hovering on. Any ideas would be really appreciated as this is the last little bit of the job to finish.

And if you do visit the test site, sorry about the music. The animation at the end fades in after 60 sec.

I am using CS3, with AS2.

Cheers,

Will