Preload external swfs -please read

Please HELP. I have individual swfs coming from a main swf. I need the preloader to work for the 5 swfs. I tried _root, _parent and _this. ???

the following code on frame 1

bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
if (bytes_loaded == bytes_total) {
this.gotoAndStop(3);
}

the following code on frame 2

this.gotoAndPlay(1);

This code is on the swf that is being called to the main swf.
WHat am I doing wrong?

[…] if (bytes_loaded == bytes_total) […]
should be
[…] if (bytes_loaded [COLOR=red]>=[/COLOR] bytes_total) […]

works 4 sure :wink:

still having a problem. Do I use this.getBytesLoaded

I’m not sure if its ,this, _root or _parent. I know people have external swfs coming up from the main.swf and need a preloader for these separate swf’s. THere’s got to be a way or I will lose my mind

here’s my standart preloader AS code (just put it in actions tab for 2nd frame of main movie):

if (_root.getBytesLoaded()/_root.getBytesTotal()>=1) {
gotoAndPlay(3);
} else {
gotoAndPlay(1);
}

i am using instance “content” to load 5 seperate swfs

What do I need to do for the preload on the individual swfs

_root.content.getbytesloaded

or

this.getbytleloaded…

I can’t figute this out.

I tought it was a better thing to make a main movie with seperate movies loading ito it. But i can’t figure out the prload for the small swfs attahed to main movie.

hi,

i feel better is :

movieClip.getBytesLoaded() and movieClip.getBytesTotal()

the path (_root / _level …etc ) depend on where you load the movie.

if you load movie at level 2 you should use
_level2.movieClip.get…

if you load movie at _root you should use
_root.movieClip.get…


if(movieClip.getBytesLoaded() >=movieClip.getBytesTotal()){
statement
}

regards
ajok
[email protected]