Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Simple text preloader?

New Here ,
Feb 01, 2010 Feb 01, 2010

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!

TOPICS
ActionScript
435
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 01, 2010 Feb 01, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 02, 2010 Feb 02, 2010
LATEST

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");

   }

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines