Hi all,
I’m trying to do this for hours…
I want to load some external swfs in sequence - after the first swf finishes I want to wait x seconds before i load the new one. Thet also have a alpha transition. I can do it with buttons, but i cant get this to work automatically.
Here’s the code
// for alpha transitions
MovieClip.prototype.fadeIn = function() {
this.onEnterFrame = function() {
if (this._alpha<100) {
this._alpha += 10;
} else {
delete this.onEnterFrame;
}
};
};
bar._visible = false;
my_mc = new MovieClipLoader();
preload = new Object();
my_mc.addListener(preload);
preload.onLoadStart = function(targetMC) {
trace("started loading "+targetMC);
_root.holder._alpha = 0;
bar._visible = true;
pText._visible = true;
};
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
bar._width = (lBytes/tBytes)*100;
pText.text = Math.round((lBytes/tBytes)*100)+ "%";
};
preload.onLoadComplete = function(targetMC) {
_root.holder.fadeIn();
bar._visible = false;
pText._visible = false;
trace(targetMC+" finished");
};
var i = 0;
var totalswfs = 2;
function loadFrame() {
my_mc.loadClip(i+".swf", _root.holder); // load swf
}
loadFrame(); // loads the first swf (0.swf)
this is the part that is working… now my problem is to load the next movies with the delay…
i tried
sequence = function () {
if (i<Number(totalswfs)-1) {
i++;
my_mc.loadClip(i add ".swf");
clearInterval(delay);
}
};
delay = setInterval(this,"sequence", 5000);
sequence();
but obviously it’s wrong…
can you please help me?
thank you so much