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 3423378
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:20:52+00:00 2026-05-18T06:20:52+00:00

I have a project where I want to use different pre-loaders from time to

  • 0

I have a project where I want to use different pre-loaders from time to time so I wanted to know if there was a way I could have my project use an external swf for the pre-loader ?

  • 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-18T06:20:53+00:00Added an answer on May 18, 2026 at 6:20 am

    Absolutely, and in fact that’s a very common practice.

    Your external preloader file just has to instantiate an instance of the Loader class, then load in your payload .swf. While the payload is loading in, you can listen for ProgressEvent.PROGRESS and use that to update some sort of a load bar or whatever. It would look something like this:

    package
    {
        import flash.display.Loader;
        import flash.display.MovieClip;
        import flash.events.Event;
        import flash.events.IOErrorEvent;
        import flash.events.ProgressEvent;
        import flash.net.URLRequest;
    
        public class Preloader extends MovieClip
        {
            // this loads in your main swf
            public var loader:Loader;
    
            // this points to the location of your main swf
            public var request:URLRequest;
    
            // this holds a reference to your main swf once it's been loaded in.
            public var content:MovieClip;
    
            public function Preloader()
            {
                addEventListener(Event.ADDED_TO_STAGE, addedHandler);
    
                super();
            }
    
            // it's a good practice to wait for ADDED_TO_STAGE before you start doing stuff, that way you can avoid certain Null Reference Errors
            protected function addedHandler(e:Event):void {
                removeEventListener(Event.ADDED_TO_STAGE, addedHandler);
    
                loader = new Loader();
                request = new URLRequest("path/to/your/file.swf");
    
                loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
                loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
                loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
            }
    
            // This will fire when your main swf is loaded in.
            protected function completeHandler(e:Event):void {
                loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, completeHandler);
                loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
                loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
    
                trace("Load completed! Now we're going to add the target swf to the timeline:");
    
                content = MovieClip(loader.content);
    
                /*
                 *      Additional logic can go here to remove your loadbar or etc.
                 */ 
    
            }
    
            // this will fire if there's a problem with loading in the swf
            protected function errorHandler(e:IOErrorEvent):void {
                trace("Error: the path specified was incorrect. Unable to find that file. Here's the error in full:\n " + e)
            }
    
    
            // this will fire constantly while the target swf is being loaded, so you can see how much more you have to load.
            protected function progressHandler(e:ProgressEvent):void {
                var perLoaded:Number = 100* (e.bytesLoaded / e.bytesTotal)
                trace("Percent Loaded: " + perLoaded);
    
                /*
                *   Additional logic can go here to update your load bar, etc.
                */
    
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have project I want to upgrade to .Net4 and it use BackgroundCopyManager.dll. Anyone
I have created SSRS project in BIDS and I want to use the reports
i'v got a trouble, i want to use Ckeditor with my project, i have
I want to add more functionality to a project I have that makes use
I have a WPF project, and there is one dialog that I will re-use
I have a project that I want to use 95% of in another project.
I have a unit which I want to use in two different programs, to
I have a new project where I want to use MVC (I will be
I have some structs that I want to use for different purposes in my
I have a project that contains 2 web application and I want to use

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.