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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:04:44+00:00 2026-05-12T18:04:44+00:00

as I learned the hard way, Flash streams your .swf, that is, it can

  • 0

as I learned the hard way, Flash streams your .swf, that is, it can start playing back the file even if only the first couple of frames are loaded.

Normally, when loading an external .swf you would just register a handler to the COMPLETE event of the Loader or URLLoader class and that would be it.
Example (exception handling, etc. omitted):

var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, completeHandler);
loader.load(request); 

function completeHandler(event:Event):void {
    //trigger starting playback here
}

However, if the .swf file is the “main” swf, that is, the one referenced from the html, I can only access the root.loaderInfo property, that is, this:

root.loaderInfo.loader.addEventListener(Event.COMPLETE, completeHandler);

gives me the error The loading object is not sufficiently loaded to provide this information.

The workaround that does the job but makes me cringe is having a timer and polling the bytesLoaded property like this:

var Poller:Timer = new Timer(500, 0);
Poller.addEventListener(TimerEvent.TIMER, waitForLoad);
var e:Event;
waitForLoad(e);


function waitForLoad(event:Event):void {
 if (root.loaderInfo.bytesLoaded < root.loaderInfo.bytesTotal) {
     if (!Poller.running) Poller.start();
     return;  
 } else {
     Poller.stop();  
     completeHandler(event);
 }
}

There has to be a better solution than this. Ideally, I could register the event handler completeHandler to Event.COMPLETE to some property of the root or stage object and it would indeed throw this event when the file gets fully loaded…
Does anyone know which property it is?

Cheers,
Zoltan

P.S.: I am using Adobe Flash CS3

  • 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-12T18:04:45+00:00Added an answer on May 12, 2026 at 6:04 pm

    Instead of

    root.loaderInfo.loader.addEventListener(Event.COMPLETE, completeHandler);
    

    call

    this.loaderInfo.addEventListener(Event.COMPLETE, completeHandler);
    

    from the constructor of the document class.

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

Sidebar

Related Questions

I just learned (the hard way) that Java Component s can only have one
As I've starting working with Javascript, I learned the hard way that when you
I've learned (the hard way) that I need to add parentheses around JSON data,
Coming from WinForms/WPF I've learned the hard way that not remembering to unhook event
I learned the hard way that i shouldn't store serialized data in a table
I've learned the hard way that regexes cannot adequately parse html, prior to finding
If learned the hard way that you should remove the delegate from an object
I used to install betas freely and learned the hard way that I best
OK, so I've learned the hard way that string comparison works ... differently in
I recently learned the hard way that #<cstdlib> rand() is not thread safe, and

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.