This content has been marked as final. Show 3 replies
Why don't you use onEnterFrame.
At the first frame you put
this.onEnterFrame = function()
var percent:Number = Math.floor(this.getBytesLoaded() * 100 / this.getBytesTotal());
if (percent == 100 && this.getBytesLoaded()>0)
this.loader._yscale = percent;
loadText.text = percent + "%"
And you remove that second frame, making the third become the second.
Any doubts, just post it.
thanks so much, that worked!! I don't know why the other one would work in the play but not online.
My only question is, what does "Math.floor" mean?
Thanks so much for your time!
Math.floor is a method of the Math class that round number to down. For exemple, if you have the number 8.7 and use the Math.round(), the return would be 9, because is the closest integer, but using the Math.floor(), the return always is equal to the integer parse of the number, and would be 8.
You have also the Math.ceil(), that round to up. In that case, would be 9.