-
-Iron Myk-
preloader math, dammit....
as stated earlier... dammit!
Why cant i understand simple math?
can someone debug my script for getting a preloader percentage?
code:
all = _root.getBytesTotal();
got = _root.getBytesLoaded();
perc = Math.floor((got/all)*100);
that's as simple as it gets, but my percentage aint working....
what have i done wrong? I've done thins a million times over, but it aint clicking tonight...
thanks,
-myk
-
It should!
But why not use...
percent = Math.floor((_root.getBytesLoaded()/_root.getBytesTotal())*100);
For future reference... This is my 10200th post.
-
-Iron Myk-
then maybe i'm screwing up with the progress bar...
code:
onClipEvent(enterFrame) {
this._width = _root.perc;
}
this should work too, no?
-myk
-
-Iron Myk-
well, for some reason, she's holding steady at 7 percent.. It is two frames.... The progress bar is one keyframe one, with an extra frame on two.. Actions layer has a stop action on frame two.. Is this killing the onClipEvent?
-
-Iron Myk-
i exhanged the stop action with an if-then statement, and it works now.. I would like to understnad why it didnt before, though..
-myk
-
I'm more intrigued by the fact that you'd be using _root.perc while it hasn't been defined that way, in your first script?
-
-Iron Myk-
that was defined earlier. The script in my first post is on the main timeline, first frame. It works now, though.
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|