Matthew_S
08-16-2008, 04:57 PM
I have created an image preloader following the tutorial found here (http://www.lukamaras.com/tutorials/preloaders/image-bottle-preloader.html).
I have the preloader in one scene and content in another.
The AS2 used for the preloader is:
stop();
rectMask_mc._height = 1;
this.onEnterFrame = function():Void {
var loadedData:Number = this.getBytesLoaded();
var allData:Number = this.getBytesTotal();
var percent:Number = Math.round(loadedData/allData*100);
rectMask_mc._yscale = percent;
if (loadedData >= allData) {
gotoAndStop(10);
delete this.onEnterFrame;
}
};
I chaged line 9 to gotoAndPlay("scene 2",1) ;
Now the preloader only appears just before scene 2 appears. Which defeats the purpose of the preloader.
Any idea how to correct this?
I have the preloader in one scene and content in another.
The AS2 used for the preloader is:
stop();
rectMask_mc._height = 1;
this.onEnterFrame = function():Void {
var loadedData:Number = this.getBytesLoaded();
var allData:Number = this.getBytesTotal();
var percent:Number = Math.round(loadedData/allData*100);
rectMask_mc._yscale = percent;
if (loadedData >= allData) {
gotoAndStop(10);
delete this.onEnterFrame;
}
};
I chaged line 9 to gotoAndPlay("scene 2",1) ;
Now the preloader only appears just before scene 2 appears. Which defeats the purpose of the preloader.
Any idea how to correct this?