Copy link to clipboard
Copied
I'm currently working on a Flash animation that requires a counter from $0-$100,000 which will be converted into a movie for a website, how easy can this be done in flash?
It needs to start 'onframe' and will not have a button to start the counter.
Thanks!
- Create a dynamic text field on the stage > give it an instance name > embed the font you want to use
- Add the following code in frame one:
var currentCount = 0;
var totalCount = 1000000;
addEventListener(Event.ENTER_FRAME, onEF);
function onEF(e:Event):void
{
currentCount +=1;
textFieldName.text = "$ " + currentCount;
/// If you want to repeat it or you want to do anything on complete count:
if (currentCount == totalCount)
{
//reset the currentCount:
curre
...Copy link to clipboard
Copied
- Create a dynamic text field on the stage > give it an instance name > embed the font you want to use
- Add the following code in frame one:
var currentCount = 0;
var totalCount = 1000000;
addEventListener(Event.ENTER_FRAME, onEF);
function onEF(e:Event):void
{
currentCount +=1;
textFieldName.text = "$ " + currentCount;
/// If you want to repeat it or you want to do anything on complete count:
if (currentCount == totalCount)
{
//reset the currentCount:
currentCount = 0;
// If you want to stop the counter:
// removeEventListener(Event.ENTER_FRAME, onEF);
}
}
Copy link to clipboard
Copied
Great, thanks nezarov for your help!
Copy link to clipboard
Copied
You're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now