KaworuNagisa
07-18-2005, 09:31 PM
Okay, I'm trying to make a progress bar shaped like a ring. Let's say the ring starts out black and then based on the loading progress, the rings fills up with blue in a clockwise motion.
I decided to try doing this by starting with something that rotates. I thought it would work if I created a movie clip that had 100 frames, then if I could find some way to set the frame number with the value of the percent variable, it would advance the animation based on the amount loaded.
Here's the code I triied using:
onClipEvent (load) {
total = _root.getBytesTotal();
}
onClipEvent (enterFrame) {
loaded = _root.getBytesLoaded();
percent = Math.floor(loaded/total*100);
rotater._currentframe = percent;
gotoAndStop(percent);
if (percent == 100) {
_root.gotoAndPlay(2);
}
}
"rotater" is the name of the Movie Clip with the animation in it. The movie can be seen here:*link gone*
You'll notice that the circle rotates not based on the amount loaded, but on the framerate (30 fps). I figure I'm just using the wrong property on the rotater line. Any ideas on how I can achieve my desired result?
KN
I decided to try doing this by starting with something that rotates. I thought it would work if I created a movie clip that had 100 frames, then if I could find some way to set the frame number with the value of the percent variable, it would advance the animation based on the amount loaded.
Here's the code I triied using:
onClipEvent (load) {
total = _root.getBytesTotal();
}
onClipEvent (enterFrame) {
loaded = _root.getBytesLoaded();
percent = Math.floor(loaded/total*100);
rotater._currentframe = percent;
gotoAndStop(percent);
if (percent == 100) {
_root.gotoAndPlay(2);
}
}
"rotater" is the name of the Movie Clip with the animation in it. The movie can be seen here:*link gone*
You'll notice that the circle rotates not based on the amount loaded, but on the framerate (30 fps). I figure I'm just using the wrong property on the rotater line. Any ideas on how I can achieve my desired result?
KN