As a total beginner in Flash, I am on an assignment where I should create a fake progress bar that should go from 0% - 98%.
Right now I have my line of progress with a total white tween over it that goes from left to right to indicate the fake download. See picture.
While the tween is running I want to increase the percentage so it matches and stops with 98% - is it possible to do this? And how?
My document is in AS3, but there is no action script yet so it does not matter right now. I mostly do timeline.
Thank you!
Significant sections of the data the progress indicator is based on are guesstimates and outright fabrication, but all this deception is there for a reason: it still provides a better user experience than any of the alternatives that you might think of.
Let's assume, your "98%" is a label which has an id "txtPercent" on the stage.
For example, you can write a function which will listen enterFrame event and update your txtPercent label.
Open the actionscript editor on the first frame and write:
import flash.events.*;
//add enterFrame event listener, when timeline frame is passed the listener function is invoked
addEventListener(Event.ENTER_FRAME, updateProgress);
function updateProgress(event:Event) {
//update the label with percent count
txtPercent.text = (currentFrame / totalFrames * 100).toFixed(0) + "%";
}
Don't forget to put stop(); in the actionscript editor for the last frame.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With