Simple text preloader?
Copy link to clipboard
Copied
Hi everyone, I'm new to Flash and these forums, and was wondering if someone can tell me or show me a link to a AS3 tutorial for a simple flash preloader? I'm using Flash CS4. I just want a SIMPLE preloader that says "Loading" and the percentage next to it. That's it. No progress bar or fancy image to go with it. I've been Googling for the past 3 hours and all the tutorials i'm finding are either for AS2 or they have a progress bar in the preloader, thus adding more stuff to the code that I don't understand or probably won't need. Thank you!

Copy link to clipboard
Copied
Hi
Here is the tutorial:
http://www.republicofcode.com/tutorials/flash/as3preloader/
http://flanture.blogspot.com/2009/11/as30-flash-preloader-with-moving.html
Saransoft
Copy link to clipboard
Copied
Place this code in frame 1
stop();
var TxtLoad:TextField = new TextField();
TxtLoad.x = 0;
TxtLoad.y = 0;
TxtLoad.width = 200;
TxtLoad.height = 50;
this.addChild(TxtLoad);
this.addEventListener(Event.ENTER_FRAME, onLoadingProgress);
function onLoadingProgress(e:Event):void
{
var nBytesTotal:Number = this.stage.loaderInfo.bytesTotal;
var nBytesLoaded:Number = this.stage.loaderInfo.bytesLoaded;
var nPercLoad:Number = Math.floor((nBytesLoaded/nBytesTotal)*100);
TxtLoad.text = "Loading... " + nPercLoad + "%";
if (nBytesTotal == nBytesLoaded)
{
this.removeEventListener(Event.ENTER_FRAME, onLoadingProgress);
trace("Loading Done.. Continue executing code here");
}
}

