Hi with the below code where can I add a pre-loader so that before anything happens my random image actually loads? My move plays and then about 5 seconds later the images starts to load…
var myClip = this.createEmptyMovieClip("mcl", this.getNextHighestDepth());
var myLoader = new MovieClipLoader();
var myListener = new Object();
var myTest = random(6) + ".jpg"; // Load 1 of 6 random images
/*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;
mcl._height = sh;
trace("New width: " + Stage.width);
trace("New height: " + Stage.height);
};*/
myListener.onLoadInit = function (mcl) { // Create fade in function
trace("load init");
mcl._alpha=0; // Make mc 'mcl' _alpha 0
mcl.onEnterFrame=function(){ // Create new function
mcl._alpha +=15; // Speed 15
if(mcl._alpha >=100){
delete mcl.onEnterFrame;
}
}
};
Stage.addListener(myListener);
myLoader.addListener(myListener);
myLoader.loadClip(myTest,myClip);