PDA

View Full Version : preloading attached swf???


sskully
09-09-2003, 02:17 AM
Help?

I've looked at other examples of preloaders, but I'm having a problem with loading a swf into empty movieclip with a progress bar.

Here's what I'm doing:

Main flash file ------------

I've a empty movie clip called "host" and a button which loads the swf file into "host" on just one frame.

on (release) {
host.loadMovie("squareMC.swf");
host._x = 0;
host._y = 0;
}

In the loaded movieclip (squareMC.swf) I have 3 frames.
The first frame has a component (JXL movie preloader lite).
It has this code in it:

onClipEvent(load){
this.stop();
_parent._parent.stop();
}

onClipEvent(enterFrame){

this.amount = Math.round((_parent._parent.getBytesLoaded() / _parent._parent.getBytesTotal() * 100));
_parent.preload_txt = this.amount + "%";
this.gotoAndStop(amount);

if(this.amount == 100){
_parent._parent.play();
_parent.gotoAndStop("done");
}
}

It works when loading this swf but doesn't work with this
swf file is loading into a movieclip..

Is it a problem with scope? Is the code not finding the swf?


Please help?

Thanks

I'll attach a zip file.

farafiro
09-09-2003, 05:50 AM
r u testing it within the flash authering mode??
if so, try it on line
also, I think it's only one _parent, not two

sskully
09-10-2003, 05:13 PM
I'll try that thanks. I found a thread here that deals just which deals with different types of preloaders. Hopefully one of their expamles will work.

Thanks again