Jump to content
Search Community

SWFLoader and framesLoaded

jurito test
Moderator Tag

Recommended Posts

Hello there,

i was wondering if it was possible to retrieve the number of loaded frames in an external swf inside an onProgress handler..

also, would the swf show its first frame content (with a stop(); on it) while continuing to load?

 

TIA for your attention and keep up the excellent work!

Link to comment
Share on other sites

i was wondering if it was possible to retrieve the number of loaded frames in an external swf inside an onProgress handler..

Sure. Just check the framesLoaded property of the rawContent, but remember that rawContent is only available AFTER the SWFLoader has dispatched its INIT event (which means the first frame finished loading). So you could do:

 

function progressHandler(event:LoaderEvent):void {
   if (event.target.rawContent != null) {
       trace("frames loaded: " + event.target.rawContent.framesLoaded);
   }
}

 

also, would the swf show its first frame content (with a stop(); on it) while continuing to load?

Yes, if you added the SWFLoader's content to the display list (like by defining a "container" or using addChild()), it will display as soon as the first frame has loaded fully. If you don't want that to happen, just don't add it to the display list initially and then listen for its COMPLETE event and at that point you can add it to the display list.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...