PDA

View Full Version : Whats wrong with this


____
03-30-2003, 08:46 PM
Im loading an external .swf into my movie and trying to preload the external
I used this code
I'm not sure whats wrong with it
any help would be appreciated
totalBytes = _root.getBytesTotal(this);
bytesLoaded = _root.getBytesLoaded(this);
percent = (bytesLoaded/totalBytes)*100;
if (percent == 100) {gotoAndStop(3);

}

texbala
03-30-2003, 11:26 PM
if u try to load the swf in an empty movieclip... (say holder)...

u need to write as


totalBytes = _root.holder.getBytesTotal(this);
bytesLoaded = _root.holder.getBytesLoaded(this);
percent = (bytesLoaded/totalBytes)*100;
if (percent == 100) {
_root.holder.gotoAndStop(3);
//u need to tell which timeline the frame has to stop
}


sample of mine

total_bytes = _root.empty_mc.getBytesTotal();
loaded_bytes = _root.empty_mc.getBytesLoaded();
remaining_bytes = total_bytes - loaded_bytes;
percent_done = int((loaded_bytes/total_bytes)*100);
_root.empty_mc.bar.gotoAndStop(percent_done);
if(loaded_bytes>=total_bytes&&loaded_bytes>0){
gotoAndPlay(5);
}
//'bar' is the preloader

____
03-31-2003, 04:35 AM
Hmm seems like a simple enough fix, but its odd the preloader only pops up for about a second, and I think it does it after it loads the whole movie.
Here is my code
totalBytes = _root.container.getBytesTotal(this);
bytesLoaded = _root.container.getBytesLoaded(this);
percent = (bytesLoaded/totalBytes)*100;
if (percent == 100) {gotoAndStop("stop");

}

and the movie im loading in is attached
and I put the fla for the movie im loading in here (http://polturk-pad.dyndns.org/mp3.swf)

avatar
03-31-2003, 08:16 AM
Hi ____ :)

Try using totalBytes = _root.container.getBytesTotal();ortotalBytes = this.getBytesTotal(); depending on where you load the movie.

Could you put the fla in here?

____
03-31-2003, 11:14 AM
I POSTED THE FLA ABOVE

____
03-31-2003, 11:17 AM
OOPS I ACCIDENTALLY POSTED THE SWF
HERE IS THE LINK TO THE FLA
SORRY
http://polturk-pad.dyndns.org/mp3.fla

avatar
03-31-2003, 11:55 AM
Hi, couldn't really figger out where you load the external swf... :(
But if you are trying to see if this swf is loaded do something like this
totalBytes = _root.getBytesTotal();
bytesLoaded = _root.getBytesLoaded();
trace(totalBytes)
trace(bytesLoaded)
percent = (bytesLoaded/totalBytes)*100;
if (percent == 100){gotoAndStop("stop");}

____
03-31-2003, 06:57 PM
I didnt know you wanted that
but i load the the mp3.swf
into this one http://polturk-pad.dyndns.org/top.fla

avatar
04-01-2003, 05:47 AM
I think we're there... :)
Put the getBytes etc. in the movie that loads the mp3.swf (instead of putting it in the mp3.swf)