getBytesLoaded() for external .swf file -- a problem with my logic - or with Flash?

I know how to setup a preloader that updates percentages for the movie being loaded. However, I need to understand how to update a percentage of a .swf movie that is being loaded dynamically.

How do I figure bytesLoaded and bytesTotal on a dynamically loaded .swf file? I’ve tried getBytesLoaded() on a .jpg and it returns a value that is close to accurate. However getBytesLoaded() and getBytesTotal() on a dynamically loaded .swf file are incorrect by a long shot. Do I want to invoke a getBytesLoaded() directly after the loadMovie command? Or do I want to invoke a command on the the empty movie clip symbol the .swf is being loaded into? For example movieClip.getBytesLoaded() – the latter returns the size of the empty symbol – which is 4 bytes.

If I invoke the getBytesLoaded without it being part of a movie clip then a value is returned which is close to the size of the flash document that is loading the external file.

I’ve attached a source file that clearly illustrates my problem. Maybe we could get some more experienced eyes on this and help me pinpoint my logic errors. All the code is in the button on the stage.

Joshua Lomelino
anomaly@anomalystudios.com
www.anomalystudios.com