Preloading external swf?

I’m loading an external swf into a blank movie clip and I would like to add a preloader to it. I’ve used this code for my preloader:

onClipEvent (enterFrame) {
var bytes = _root.getBytesTotal();
var bytes_loaded = _root.getBytesLoaded();
if (bytes_loaded == bytes) {
_root.gotoAndPlay(2);
this.pootxt = “movie loaded”;
} else {
_root.gotoAndStop(1);
this.pootxt = “loading (” + bytes_loaded + “/” + bytes +")";

}

}

It does not seem to work. I think (and I could be way off as I’m pretty new at this) that the _root.gotoAndPlay(2) is the cause of the problem. It seems to target my main timeline instead of the external swf…

Any help will be much appreciated…

Thanks,

-P.

pretty much yes :slight_smile:

replace _root with [color=red]this[/color] =)

“_parent” seemed to work, is “this” better?

-P.

oh wait … :crazy:

if the code is in a movie clip in the swf then yes … use _parent
i thought it was in the movie clip that loads the swf :stuck_out_tongue:

Thanks a bunch…:slight_smile:

-P.

no problem :wink:

but … i didn’t do anything this time :stuck_out_tongue:

lol! =)

:crazy: :wink:

oh well … i should get back to work :-\