can someone
Out of context: Reply #10
- Started
- Last post
- 11 Responses
- fifty500
ok if you make a new movie clip for your preloader, put that code on the root timeline.
the variables "iz", "ttl", "per", and "perc" I just made up for the math, you can make them whatever you want. the "perc" variable should be the Var name for the dynamic text box which would show the percent loaded.
OK so you've got the box on the stage and it's instance name is BAR, and the width of this box is "per*1.5", where "per" is the percentage of the movie clip loaded, multiplied by 1.5, so when the percent loaded is 100, the box will be 150 pixels wide, thus filling my progress bar. since this code is on the root timeline of the preloader movie clip, it tells it to go to the frame labelled as "complete" in my preloader. that frame then has code telling it to go to the next frame in the root timeline. here's that code again if you need it.
iz = _parent.getBytesLoaded();
ttl = _parent.getBytesTotal();
per = Math.floor((iz*100)/ttl);
perc = per+"% Complete";
BAR._width = per*1.5;
if (per >= 100){
gotoAndPlay("Complete");
}