View Full Version : Timer With hitTest
SChaput
11-05-2008, 11:26 PM
I am having many problems trying to get my timer working correctly using as2. I want the timer to start when the movie enters the second frame, the person watching the movie needs to see the timer incrementing, like a score, and then to stop once a hitTest has been detected.
Help is appreciated.
Thanks.
Medyman
11-06-2008, 12:21 AM
The timer (will increase "seconds" by 1 every second):
var seconds:Number = 0;
function addTime() {
seconds++;
trace(seconds + " seconds have elapsed")
}
var interval = setInterval(addTime, 1000);
To shut it off:
clearInterval(interval);
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.