I have become stuck with my knowledge of as.
I have a series of MC’s in my library which need to fade (on a timer) ontop of each other. so movieclip1 fades in. pause for so many seconds then movieclip2 fades ontop and once it completes to _alpha = 100 movieclip1 unloads I have about 7 mcs in total.
I have a buch of code which I have now become lost in.
var currentInt:Number = 0;
function timer_fun(delayy:Number) {
this.stop();
var timer:Number = getTimer();
currentInt = setInterval(function (){
if (getTimer()-timer>delayy) {
trace("here"+currentInt);
clearInterval(currentInt);
_root.gotoAndStop("nextFrame");
}
}, 10);
}
Timer function
import mx.transitions.Tween;
import mx.transitions.easing.Regular;
//
var container1:MovieClip = this.createEmptyMovieClip("c", this.getNextHighestDepth());
//
target_mc.onEnterFrame = function() {
// fade out container
var tween_handler:Tween = new Tween(container1, "_alpha", Regular.easeOut, container1._alpha, 0, 1, true);
tween_handler.onMotionFinished = function() {
// attach appropriate movie clip
myContent = container1.attachMovie("image1", "image1", this.getNextHighestDepth());
// fade in container
var fadeIn:Tween = new Tween(container1, "_alpha", Regular.easeOut, container1._alpha, 100, 1, true);
};
};
attach and fade. I need to somehow combine the two also using an array so I dont have to call each mc in the library individually.
Second code came from Kovax and post