Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6155149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:23:04+00:00 2026-05-23T20:23:04+00:00

I want to make a loading bar but at first I need to have

  • 0

I want to make a loading bar but at first I need to have loading info per enter frame. This is how I do it but it seem not working. Could you teach me how to do it?

 var mapLoader : Loader = new Loader( );
     var mapLoaderInfoLoad:Number;
     var mapLoaderInfoTotal:Number;

public function engine() 
{

        addEventListener( Event.ENTER_FRAME, onEnterFrame,false,0,true );

        mapLoader.load( new URLRequest( "Mapcontrol.swf" ) );
        mapLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler );

}
private function onEnterFrame( evt:Event ):void
    {mapLoaderInfoLoad = mapLoader.loaderInfo.bytesLoaded;
        mapLoaderInfoTotal = mapLoader.loaderInfo.bytesTotal;
        trace(mapLoaderInfoLoad);
        trace(mapLoaderInfoTotal);}

public function completeHandler ( eventOBJ : Event ) : void
     {
         stage.addChild( mapLoader.content );
     }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T20:23:07+00:00Added an answer on May 23, 2026 at 8:23 pm

    The bytesTotal of a Loader’s loaderInfo will return 0 until the Loader has fired it’s first progress event. Is there a reason why you want to use an enterFrame in this way rather than the progress event?

    Simple Progress Event Example:

    var mapLoader : Loader = new Loader();
    var mapLoaderInfoLoad:Number;
    var mapLoaderInfoTotal:Number;
    
    public function engine() 
    {
        mapLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler );
        mapLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
        mapLoader.load( new URLRequest( "Mapcontrol.swf" ) );  
    }
    
    private function progressHandler(evt:ProgressEvent):void
    {
        mapLoaderInfoLoad = evt.bytesLoaded;
        mapLoaderInfoTotal = evt.bytesTotal;
        trace(mapLoaderInfoLoad);
        trace(mapLoaderInfoTotal);
    }
    

    Enter Frame

    Of course, there might be a reason for you to use an enterFrame event. You could still do so as in your example, but let the progressHandler from my example populate your variables; or wait until the first progress event is fired, then delete the progress event listener and add your enterFrame listener instead. As long as you don’t try to read mapLoader.loaderInfo.bytesTotal before the first progress event is fired you should be OK.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have style sheet with a class name changebackgroundcolor i want make change in
I have link for example domain.com/de/controler/action?param=value and I want make actionlink to keep same
I have uploaded a app in production mode to linode. I want make changes
I want to make 3d games for the iphone and with all this doubt
I want to make an application with plugins that also can have plugins (which
I want to make a loading screen(Splash screen) for my Java SE app. And
How can I make loading page in android? I want it when my application
I want to make a loading message when an app processes, so I used
First of all, I have to use and create this DOM element in a
I have a want to make a jython and python communcation link. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.