Hi everyone,
The code at the end of this post is code I have on frame 1 of the main timeline.
The movieclip called intro_mc is first called on to play with this code:
intro_mc.onEnterFrame = function () {
this.play();
delete intro_mc.onEnterFrame;
}
Then the movieclip called categoryIndex_mc is set to fade in gradually using the rest of the code.
The problem is that categoryIndex_mc fades in at the same time that intro_mc is playing. I need intro_mc to reach the end of its timeline before categoryIndex_mc will come in. I tried enclosing the function in an if statement but this just caused categoryIndex_mc not to appear at all.
Can someone tell me how to correct the code?
Appreciate any help offered.
//-----------Initialization---------\\
this.categoryIndex_mc._alpha = 0;
this.garmentSlides_mc._alpha = 0;
//-----------------------------------\\
intro_mc.onEnterFrame = function () {
this.play();
delete intro_mc.onEnterFrame;
}
//-----------Category list fades in---------\\
var oIntervalIDs:Object = new Object();
if (this.intro_mc._currentframe == 60) {
function fadeMovieClip (mClip:MovieClip, nRate:Number):Void {
if(mClip._alpha >= 0 && mClip._alpha < 100) {
var nAlpha:Number = mClip._alpha;
mClip._alpha = nAlpha + nRate;
updateAfterEvent();
}
else {
clearInterval(oIntervalIDs[mClip._name]);
}
}
}
oIntervalIDs[categoryIndex_mc._name] = setInterval(fadeMovieClip, 100, categoryIndex_mc, 5);
categoryIndex_mc.onEnterFrame = function () {
if(categoryIndex_mc._alpha > 95) {
this.indexBack_mc.gotoAndPlay(30);
delete categoryIndex_mc.onEnterFrame;
}
}