How can I apply a nice image fade to my random load after the preload
AS:
fscommand(“allowscale”, “true”);
//Preload Function
_root.bar._visible = 0;
_root.barBorder._visible = 0;
MovieClip.prototype.loadPic = function(pic) {
this.loadMovie(pic);
this._parent.onEnterFrame = function() {
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
bar._visible = 1;
barBorder._visible = 1;
per = Math.round((l/t)*100);
if (t != 0 && Math.round(l/t) == 1 && containerMC._width != 0) {
bar._visible = 0;
barBorder._visible = 0;
loadText3.text = “”;
delete this._parent.onEnterFrame;
} else {
bar._width = per * 2;
loadText3.text = per+" % loaded";
}
};
};
//Random images
pics = new Array(“forside_1.jpg”, “forside_2.jpg”, “forside_3.jpg”, “forside_4.jpg”, “forside_5.jpg”);
var randNum = getRandom(0, 3);
_root.containerMC.loadPic(pics[randNum], pics[randNum], 100);
pics[randNum]._x = 0;
pics[randNum]._y = 0;
// function to generate a random integer
// between minimum and maximum, inclusively
function getRandom(minimum, maximum) {
return Math.floor(Math.random()*(maximum-minimum+1)+minimum);
}
Any Idea