Skip to main content
May 11, 2010
Answered

Preloader in AS3

  • May 11, 2010
  • 1 reply
  • 742 views

hi,

Can u give  me any idea how to creat preloader in as3..

Plz help me guys m new in as3

Thanks,

JaxNa

This topic has been closed for replies.
Correct answer kglad

on first Key frame the following code

loader is a movie Clip

percent is a text field

stop();

addEventListener(Event.ENTER_FRAME, preloader);

function preloader(evet:Event){   
    var load_value:Number = this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal;
    loader.scaleX = load_value;
    if (this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal){
        this.gotoAndStop(2);
        removeEventListener(Event.ENTER_FRAME, preloader);
    }
}


here:  www.kglad.com/Files/forums/Untitled-5.fla

p.s.  please mark this thread as answered.

1 reply

kglad
Community Expert
Community Expert
May 11, 2010

a preloader for swf that contains the preloader or for something that's being loaded into the swf that contains the preloader?

May 11, 2010

yes

Like this one

Thanks

kglad
Community Expert
Community Expert
May 11, 2010

are you using a loader?  if yes, copy and paste your loader code.  if no, you must want a preloader that will display the load progress of your main swf.