Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 479
  • Last Modified:

How do I create a countdown timer in ActionScript 3?

I have a website where the menu buttons are not particularly easy to find. I want to have an arrow sign come up saying "Click Here" if the user hasn't clicked on any buttons after say 20 seconds. How would I go about coding this?
0
cheezy102
Asked:
cheezy102
1 Solution
 
deepanjandasCommented:
0
 
Jeremy DaleySenior DeveloperCommented:
Here's a simple way:
 
var myTimer:Number = setTimeout(onTimerReached, 20000); // Time in milliseconds

function onTimerReached():void
{
    // Do whatever
}

// If user has clicked somewhere and you want to cancel the timer:
clearTimeout(myTimer);

Open in new window

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now