What part are you having trouble with? Getting milliseconds? Displaying the time? Starting and stopping?
I dont know how to display the time and control the starting and stopping. I know how to display the time in flash but i want to learn to do it in flex 4.
I think its an easy task . You may get a flash version of stop watch form here,
I just comvert it to flex compoment . You may use any one of this ,
But here is a problem , here i get a unit 100ms for the counter . Flex timer cannot call 1ms . But Why !!
Cannot call ,
timer = new Timer(1);
I think you should remember that a lot of things are going on in a computer and there is a limit to how quickly software can respond to/process a function call that trying to use an interpreted system like flash for an accurate 1ms timer, is going to be a problem. Neither Flash nor windows is designed to do real-time processing. The system has latency that is longer than 1ms. You should also remember than a timer for any duration does not guarantee that the timer will call the handler at exactly the specified time, it just says that the handler will be invoked at that time or later. Also consider the fact that it may not make sense to expect a timer to fire more often than the frame rate of the movie.
Thanks , Its so useful for me . I am finding this answer for long . Happy Flexing.
Wow thank to everybody for the help so far. Basically i need it to read 00:00:00:00 so i wouldnt need a 1ms but a 10ms.
@firstname.lastname@example.org thanks for your help so far. Your code works perfectly except that i need it to pull in the current time then start counting. Thanks for geting me started, i hope i can figure it out. And if you have any sugestions as to how i can do that let me know.