I’m trying to preload an external .swf…
In my main movie I have the folowing script:
loadMovieNum(“mainmovie.swf”,2);
In the external movie I have this code looping:
myBytesLoaded = _parent.getBytesLoaded();
myBytesTotal = _parent.getBytesTotal()/percentLoad;
if (myBytesLoaded<myBytesTotal) {
percentOutput = int((myBytesLoaded/myBytesTotal)*100)+"%";
setProperty(“loadbar”, _xscale, (myBytesLoaded/myBytesTotal)*100);
} else {
this.play();
}
==========================================
The preloader works fine when I test the external movie by itself, but when it’s loaded externally it fails.
Please help, this is killing me.
system
October 22, 2002, 6:44am
2
It should work fine…
Perhaps the _parent is throwing it off.
Since you put a preloader on the main timeline, there is no need for _root or _parent.
And this.play() can just be play()
system
October 24, 2002, 1:14am
3
I HAVE THE SAME PROBLEM!!!
:*(
system
October 24, 2002, 4:10am
4
I got mine to work.
make sure you are loading movie using the following:
loadMovieNum (“movie.swf”, 1);
the code that sits in the preloader movie clip on frame 1:
myBytesLoaded = _parent.getBytesLoaded();
myBytesTotal = _parent.getBytesTotal()/percentLoad;
if (myBytesLoaded < myBytesTotal) {
percentOutput = int((myBytesLoaded/myBytesTotal)*100)+"%";
setProperty("loadbar", _xscale, (myBytesLoaded/myBytesTotal)*100);
}
else {
_parent.play();
stop();
}
Hope that helps…
system
October 24, 2002, 12:11pm
5
hmmm thanx… glad u sorted it. The thing is, Im loading my external .swf files into a traget movie clip, wheras you are using levels.
My code therefore looks like:
Main movie code:
_root.contents.loadMovie(“welcome.swf”);
(simple preloader on external swf)
total = getBytesTotal();
loaded = getBytesLoaded();
if (loaded>=total) {
gotoAndPlay(41)
}
system
October 24, 2002, 8:32pm
6
I initially planned the site the way you are doing it. I haven’t found a way to get the preloader to work using the target method. If you happen to find a solution please let me know.