View Full Version : Need Preloader

05-16-2007, 04:47 PM

Can someone please recommend a .fla or Tutorial for creating preloaders for movies that get loaded into targets?

I've created many preloaders that work great. The preloader goes into the first scene, and when x number of frames are loaded in the Main scene, then the action takes us to the first frame of the Main scene. [Found that preloader here actually, thank you].

total_bytes = _root.getBytesTotal();
loaded_bytes = _root.getBytesLoaded();
remaining_bytes = total_bytes-loaded_bytes;
percent_done = int((loaded_bytes/total_bytes)*100);
ifFrameLoaded ("Main", "frame100") {
gotoAndPlay("Main", "frameone");

But this type of preloader does not work for an external.swf that's loaded into a target on level0. When the button action takes place calling up the .swf that's loaded into the target, the preloader never shows up. Nothing shows up until the 'entire' .swf is loaded, and then, of course, it goes right to the first frame [frameone].

So, is there another way to do this? Or will this type of preloader not work with movies that are loaded into targets?

Is there another type of preloader all together that will work for this purpose.

Thanks so much for your help.


05-16-2007, 07:55 PM
Look into the MovieClipLoader class, there is a method called onLoadProgress that will point you in the right direction.

live docs on MovieClipLoader (http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002538.html)

05-16-2007, 09:42 PM
I'm still having trouble getting anything to work. I looked at the tech article on MovieClipLoader, and it only made my head spin. I am exhausted from overwork on this project.

I've built a small set of sample.flas that mimic my project. They are attached. If someone could take a look at my code [button & preloader], and tell me what is wrong, I'd be EXTREMELY grateful.

Essentially, my nav button needs to load a .swf into a target. In real life, this .swf is quite large, and so needs a preloader.

Thank you, a million thank yous.

05-17-2007, 03:58 AM
After some further testing, it seems the code in the 'Nav.swf' button is not working. I don't know why it isn't working. I'd be very grateful if someone could help me out with this.

Thanks so much.