PDA

View Full Version : preloader for SWF loaded into SWF



russsty1
March 1st, 2003, 05:58 PM
Hi All,

Can you tell me the solution to getting progress bars to work in on an SWF that is coded to load into your main SWF movie that sits on the web?

My progress bar just sits on 100% and indicates no progress at all?

Where do I change the code from a normal bar?

Hope you can help:
rusty_:q:

Jubba
March 1st, 2003, 06:24 PM
try changing everywhere that it says "_root" to "_parent" that might work..

russsty1
March 1st, 2003, 07:06 PM
Thanks, I have put this code onto frame 1 of the SWF I am loading into the 'targetClip' that sits on my mainSWF, and have tested online but the 100% bar is just sticking on 100% untill the movie loads!

this.onLoad = function(){
myWidth = myBar._width /100;
myBar._width = 0;
}
this.onEnterFrame = function() {
total_bytes = Math.round(_parent.getBytesTotal()/1000);
loaded_bytes = Math.round(_parent.getBytesLoaded()/1000);
remaining_bytes = total_bytes-loaded_bytes;
percent_done = Math.round(_parent.getBytesLoaded()/_parent.getBytesTotal()*100);
displaypercent = percent_done +" %";
myBar._width = 1.7 * percent_done;
trace(myWidth);
bar.gotoAndStop(percent_done);
ifFrameLoaded ("Scene 2", 7) {
gotoAndStop ("Scene 2", 1);
}
}

any further ideas?
ta_
russsty_

kode
March 2nd, 2003, 05:28 AM
this or _level#.targetClipInstanceName should work :)