PDA

View Full Version : Fading My Loaded MC Before Going To FrameLabel



tomyknoker
03-29-2007, 03:15 AM
I have the below code:


numOfBtn = 6;
stop();
for (i=0; i<numOfBtn+1; i++) {
this["btn"+i].num = i;
this["btn"+i].onRelease = function() {
gotoAndStop("frm"+(this.num+1));
};
this["btn"+i].onRollOver = function() {
this.play();
};
this["btn"+i].onRollOut = function() {
this.onEnterFrame = function() {
if (this._currentframe != 1) {
this.prevFrame();
} else {
delete this.onEnterFrame;
}
};
};
}

I have six buttons, which animate onRollOver and reverse the animation onRollOut... onRelease it sends it to 'frm1-frm6' respectively depending on which button is pressed. Say for example btn1 is pressed and the user is taken to framelabel 'frm1'. On each framelabel I have this code:



var myTest = "images/manly/manly" + 2 + ".jpg";
_root.myLoader.loadClip(myTest,_root.myClip);

This loads a bg image, onto the stage. It calls myClip which plays from allpha 0-100. This is the code for myClip, so you can se what it does:


var myClip = this.createEmptyMovieClip("mcl", this.getNextHighestDepth());
var myLoader = new MovieClipLoader();
var myListener = new Object();
var myTest = random(6) + ".jpg";

Stage.align = "TL"; // Position the movie at top, center
Stage.scaleMode = "noScale"; // Prevent scaling (required!)

myListener.onResize = function (e:Object):Void {
var sw:Number = Stage.width;
var sh:Number = Stage.height;
mcl._width = sw;
trace("New width: " + Stage.width);
};

myListener.onLoadInit = function (mcl) {
trace("load init");
mcl._alpha=0;
mcl.onEnterFrame=function(){
mcl._alpha +=15;

if(mcl._alpha >=100){
delete mcl.onEnterFrame;
}
}
};

Stage.addListener(myListener);
myLoader.addListener(myListener);
myLoader.loadClip(myTest,myClip);

Basically after all that! What I want to try and do is when 1 of the 6 buttons is pressed and it moves to a framelabel and loads the image into 'mcl', before it does this I want the old loaded image to fade out and then for the playhead to move to the new framelabel... Sorry it's really hard to explain on here sometimes... If anyone understands and can help me out would be much appreciated!

BLiZZaRD
04-13-2007, 03:36 PM
Same as the other post I answered? No? If not I will try to get back soon with another answer for you :)