I have been trying to create a transition between multiple mc’s loading with the movieClipLoader.
What I want is if a image has been loaded into my imgHolder and the user clicks to load another image then it fades out imgHolder then replaces the previously loaded image with the new one.
I have been able to get the first mc to fade it but don’t know how to make the imgHolder fade out and then load in the new image that will trigger mcl.
// ------------[ MovieClipLoader Setup ]------------//
var mcl:MovieClipLoader = new MovieClipLoader();
var mclListener:Object = new Object();
mcl.addListener(mclListener);
// ------------[/ MovieClipLoader Setup ]------------//
// **
// ------------[ LoadClip Method w/ Event Listener]------------//
mclListener.onLoadInit = function() {
onEnterFrame = function () {
if (imgHolder._alpha<100) {
imgHolder._alpha += s;
} else {
trace("I am at 100");
delete onEnterFrame;
}
};
};
// ------------[/ LoadClip Method w/ Event Listener]------------//
// **
// ------------[ Variables]------------//
var pressed:String;
var pTime:Number = 1;
var s:Number = 5;
// ------------[/ Variables]------------//
// **
// ------------[ Create Navigation]------------//
function generateNav():Void {
var xPos:Number = 259;
var yPos:Number = 10;
for (var i:Number = 1; i<=6; i++) {
var thumb:MovieClip = attachMovie("hero"+i, "myHero"+i, this.getNextHighestDepth());
thumb._x = xPos;
thumb._y = yPos;
thumb._alpha = 0;
xPos += thumb._width+10;
if (xPos>550) {
xPos = 259;
yPos += thumb._height+10;
}
trace(thumb);
thumb.iVar = i;
thumb.onRollOver = function() {
this.onEnterFrame = function() {
if (this._alpha>40) {
this._alpha -= s;
} else {
delete this.onEnterFrame;
}
};
};
thumb.onRollOut = function() {
this.onEnterFrame = function() {
if (this._alpha<100) {
this._alpha += s;
} else {
delete this.onEnterFrame;
}
};
};
thumb.onPress = function() {
if (pressed == undefined) {
slideNav();
pressed = "defined";
thumb._alpha = 40;
//mcl.loadClip("images/image"+this.iVar+".jpg", imgHolder);
trace(this.iVar+" Pressed");
} else {
mcl.loadClip("images/image"+this.iVar+".jpg", imgHolder);
trace("pressed");
}
};
}
}
//
generateNav();
// ------------[/ Create Navigation]------------//