all groups > flash actionscript > january 2007 >
You're in the

flash actionscript

group:

Preloader not working


Preloader not working mb126
1/15/2007 11:25:47 PM
flash actionscript:
Hey, im hoping someone can help me. Firstly I'm a designer not a programmer and
rarely dip my toes in the pool at this end but need some help with a preloader
problem I'm having. I have a main movie with a preloader that works fine, this
main movie has 6 buttons that load external swf's when clicked. Each of these
SWF's have the same preloader at the start of the timeline. When I click on any
of these buttons in the main movie the external movie will load but without
using the preloader all that I get is a blank screen for up to ten seconds
(long enough for the client to think it is broken). Iv'e seen plenty of forum
topics on how to create a preloader in the main movie that will display the
loading time for an external swf but what I want to know is why the preloader
wont work if it is part of the external swf. this is the code I am using:

total_bytes = _root.getBytesTotal();
loaded_bytes = _root.getBytesLoaded();
remaining_bytes = total_bytes-loaded_bytes;
percent_done = int((loaded_bytes/total_bytes)*100);
bar.gotoAndStop(percent_done);
if (percent_done > 99) {
gotoAndPlay("Start");
}

Any help would really be appreciated.

Cheers
Re: Preloader not working kglad
1/15/2007 11:36:20 PM
instead of use "_root" in your external files use "this". or use:

this._lockroot=true;

AddThis Social Bookmark Button