473,383 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

How do I reset a TIMER?

2
Im trying to make a reaction game. I have a grafic that comes up, and the timer starts and when i hit the grafic the timer stops. But my problem is that the Timer doesn't reset.
Can anybody help me? :D
Apr 12 '12 #1
2 4451
johny10151981
1,059 1GB
what timer are you talking about?
Apr 13 '12 #2
Maghov
2
I'm not quite sure. but I made ​​it to reset. but now my problem that I do not get it to measure the seconds. This is the code. you see the error?

var minTimer:Timer = new Timer(1);
minTimer.addEventListener(TimerEvent.TIMER, timer);
btnStart.addEventListener(MouseEvent.CLICK, Start);
btnIgjen.addEventListener(MouseEvent.CLICK, Start);
btnIgjen.visible=false // gjør prøvigjen knappen usynlig
btnIgjen.enabled = false // kobbler ut knappen
function Start(evt:MouseEvent)

{
minTimer.start(); // starter "stoppeklokken"
btnStart.visible = false; // gjør start knappen usynlig
btnStart.enabled = false; // kobbler ut startknappen
skiMann.x = 100 + (350 * Math.random()); // Beveger objektet random borter(x)
skiMann.y = 100 + (300 * Math.random()); // Beveger objektet random oppover(y)
btnIgjen.visible=false
btnIgjen.enabled = false


}
function timer (evt:TimerEvent)
{
new Timer = 1000;
var reaksjonstid:Number = minTimer.currentCount/100 //
trace(reaksjonstid)
txtResultat.text = "Din reaksjonstid er " + String(reaksjonstid.toFixed(2)) + " sekunder"; // får tiden ut i et tekstvindu

}


skiMann.addEventListener(MouseEvent.CLICK, klikk) // lager en "Click" funksjon på symbolet skimann
function klikk(evt:MouseEvent)
{

minTimer.reset() // resetter timeren når du trykker på skimannen.
minTimer.stop(); // stopper timeren når du trykker på skimannen
btnIgjen.visible=true;
btnIgjen.enabled = true



}
Apr 13 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Manuel Lopez | last post by:
I have a puzzling form timer problem that I didn't experience prior to Access 2003 (though I'm not sure access 2003 is to blame). Here's the situation: a computer has two access 2003 databases on...
3
by: Gianmaria I. | last post by:
Hi, i'm using a timer like this: System.Timers.Timer myTimer= new System.Timers.Timer(60000); in some conditions i want my timer to be reset... so if something happen i know i want the timer to...
7
by: Noozer | last post by:
I have a timer on a form. It isn't firing at all. I know that the timer is enabled, and that the interval is low (4000, which should be 4 seconds). To ensure the timer wasn't being inadvertantly...
4
by: Dan | last post by:
Hi, I have a timer on a form (System.Windows.Forms.Timer - Framework 1.1) that is set to 60 seconds as sort an of inactivity monitor. If 60 seconds have elapsed without any user activity I want...
7
by: Mike Eaton | last post by:
Hi All, I have a simple application that allows users to clock in and out and stores the data for use by the payroll department. It spends most of its life as a tray icon and when the user...
1
by: jmgro | last post by:
I have spent way too much time trying to solve the following problem: I have a datalist with a timer in the footer template. It works wonderfully except when the user pages back, then forward,...
1
by: archana | last post by:
Hi all, I want to clear one doubt which i am facing regarding timer. Suppose i have one timer in which i am generating some files. and interval of my timer is say 5 min. Say suppose at...
0
by: qiangdi_he | last post by:
Hi, Pals, I am using WaitAny( ) to wait for the events triggered by a timer. But it seems like that when the timer's interval elapsed, and the event was set, but WaitAny is still waiting there....
3
by: John Salerno | last post by:
I'd be curious to know if this works any differently on other computers/platforms or while other things are happening in the background. I can't tell if it's the Timer object that isn't keep...
4
by: Bails | last post by:
Hi Im an absolute beginner in programming and am using VB.Net Express. To start my larning I decided to do a "Real World" app instead of "hello world" and am creating a Poker Countdown clock. ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.