Faking progress bar

As a newbie to Flash, I am in a job where I have to create a fake progress bar, which should go from 0% to 98%.

Right now I have my progress line with full white animation above it, which goes from left to right to indicate a fake download. See Figure.

alt text

While the animation is working, I want to increase the percentage so that it matches and stops with 98% - can this be done? And How?

My document is in AS3, but there is no script action, but now it does not matter. I basically do a timeline.

Thanks!

+7
flash actionscript-3 progress-bar
source share
1 answer

Suppose your "98%" is a label with the identifier "txtPercent" in the scene.

For example, you can write a function that will listen for the enterFrame event and update the txtPercent label.

Open the actionscript editor in 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) + "%"; } 

Do not forget to put stop (); in the actionscript editor for the last frame.

+2
source share

All Articles