Link to home
Start Free TrialLog in
Avatar of Brant Snow
Brant Snow

asked on

Flash actionscript 2 load external swf with preloader

Im looking to load an external swf file into my movieclip with the instance name holder_mc, i would like to show the progress of loading within my dynamic text field instance name loading_txt

how would i do this in actionscript 2
Avatar of florimit
florimit
Flag of United States of America image

try something like this :

loading_txt.text = (holder_mc.getBytesLoaded() / holder_mc.getBytesTotal() * 100) + "%";
Avatar of Brant Snow
Brant Snow

ASKER

so that would maybe show the loading but what about loading the swf.   So lets so my external swf file is called external.swf and i want holder_mc to load it, what is that going to look like?
ASKER CERTIFIED SOLUTION
Avatar of Antonio Estrada
Antonio Estrada
Flag of Mexico image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I usually use this (attached) class for all my preloader needs. It's completely customizable and reusable in other projects. Since I can't attach FLA files, please drop me an e-mail at ayanaculis@shoclabs.com and I'll be happy to send you the rest of the code.

Just copy the class in the same folder as your *.fla, then just copy the frames in the FLA I'll send to you to your own. You can change the loading animation (progress_mc_ext) Note that it should always be 100 frames long. You can also change the font and size of the preloading text, just remember to embed the font.

If you need further explanation on how it works, please feel free to ask.
Preloader.as