Click to See Complete Forum and Search --> : displaying percent loaded in preloader

06-16-2001, 11:07 AM
if (Number(_framesloaded)>=_totalframes) {
gotoAndPlay ("loaded");
} else {
setProperty ("loader", _xscale, (_framesloaded/_totalframes)*100);

i use the above script in a preloader scene and it works great.

i want to have the pecentage loaded displayed on the screen. i know how to display a dynamic variable, but how do i create the variable to display. IOW, how do i set a variable equal the the percentage loaded? i tried displaying the value of "loader", but it didn't work. i am stumped. i even tried creating a new variable "percentloaded" and set it to: (_framesloaded/_totalframes)*100. any ideas? thanx.

06-18-2001, 10:57 AM
i think this is the right equation for displaying the percent with _framesLoaded:

percent = Math.round(100/(_root._totalFrames/_root._framesLoaded))

then you could say:

if (percent == 99 ) { _root.play() }

or something like that.

i use the math.round function because it rounds the number for display in the dynamic text field automatically - in this case it would be named "percent"

i hope that helps! :D