Groups | Blog | Home
all groups > flash actionscript > february 2007 >

flash actionscript : Preloader Problem



dan mode ->Adobe Community Expert
2/2/2007 1:27:48 PM
Max,
Give this a try, it will go to the frame you designate when the preloader
reaches 90%


//
bytes_loaded = Math.round(_root.getBytesLoaded())+1;
bytes_total = Math.round(_root.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
trace("getPercent " +getPercent )
backwards = getPercent*242;
_root.loadBar._width = 242-backwards;
_root.loadText = Math.round(getPercent*100);
//if the getPercent equals 90 percent then gotoAndPlay 2
if (getPercent>=.90) {
_root.gotoAndPlay(4);
}

//

--

Dan Mode
--> Adobe Community Expert
*Flash Helps* http://www.smithmediafusion.com/blog/?cat=11
*THE online Radio* http://www.tornadostream.com
*Must Read* http://www.smithmediafusion.com/blog




[quoted text, click to view]

Max5005
2/2/2007 7:04:31 PM
Hi,
I have a flash document. One swf file. I have a preloader that works fine
using total bytes of the the file and total loaded bytes.
I have a situation where I want show loading progress up to a certain frame,
not the whole document.
I know I can use total frames loaded compared with my target frame, however
90% of the data is in one frame.
So if I use frames to calculate the progress, the % loaded will stay at 10%
for a while and then will jump to 100%.
I can't use total bytes because I don't want to wait for the whole document to
load.

So is there a way, to find out the what the byte total is at a certain frame.

Thanks
Max
AddThis Social Bookmark Button