| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Feb 2006
Posts: 6
|
Has anyone else run into the Timer class firing way off schedule?
Like I have my Timer running at 50 msecs, but the output on the TimerEvent.TIMER call is sometimes firing at over twice the rate? I recall flash 8's setInterval being at least a little better as far as the timing of the firing ... there a workaround? my 50msec timer output: ------------------------ 7111 7214 7296 7358 7460 7542 7604 7706 7788 7850 7952 8055 8137 8198 8280 8342 8424 8485 8588 8670 8732 |
|
|
|
|
|
#2 |
|
Addict
Join Date: Nov 2001
Location: London
Posts: 2,128
|
have you tested this in a movie with nothin else going on?
even though its a Timer i believe its still relies on frame rate and therefore can slow down as your movie slows down. |
|
|
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: Feb 2006
Posts: 6
|
it's literally a blank movie with nothing going on but the timer. frame rate set to 20. computer speed @ 3 ghz.
|
|
|
|
|
|
#4 |
|
Registered User
Join Date: Jul 2006
Posts: 5
|
I had the same problem when trying to create an animation using the timer. I didnt find a fix though.
|
|
|
|
|
|
#5 |
|
Registered User
Join Date: Jul 2006
Posts: 85
|
I may be wrong here, but the Timer object will never execute code at the exact time, but rather at the next frame from the exact time.
Even though you set your framerate to 20=1 frame per 50ms, Flash's framerate is never 100%. So if only 1 frame takes a bit more to execute, the Timer will be delayed by an entire frame. It's just a guess, but it seems plausible to me. |
|
|
|
|
|
#6 |
|
Registered User
Join Date: Jul 2006
Posts: 13
|
Interesting, but I thought the whole idea behind the Timer was that it allowed seperation from frame based events. Just to see, have you tried pushing your frame rate up to say 300 or something silly?
|
|
|
|
|
|
#7 | |
|
Registered User
Join Date: Jul 2006
Posts: 85
|
Quote:
|
|
|
|
|
|
|
#8 | |
|
Registered User
Join Date: Jul 2006
Posts: 13
|
Quote:
Director can get wound up to 999 fps. although it is near impossible to actually get it to run at that rate.Ok, so set it to 120 and see what happens. |
|
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Apr 2001
Location: Kansas City
Posts: 671
|
Is there still an updateAfterEvent in AS3? That would update your stage independently of the framerate. In previous versions of flash this was useful for fluid mouse events that weren't necessarily happening each frame.
Edit: After searching I found it: http://livedocs.macromedia.com/labs/...ateAfterEvent() I would say that's the way to make it happen, cap'n.
__________________
The coolest website ever! Do you live in Kansas City? Come to KC Web Core and expand your skillset! Last edited by Kraken; 07-19-2006 at 10:20 PM.. |
|
|
|
|
|
#10 |
|
Registered User
Join Date: Mar 2007
Posts: 25
|
Hi all,
I am in need of a timer that works perfectly down to the hundredth of a second and I found this site and the link that was left by Kraken. I installed flash alpha 9 and ran the timer code and it does not work very well at all. It's hard to know by looking at trace outputs - but if you put a short sound in the timer and have it start every time the timer goes off, you can easily tell that it does not work very well at all. Any other suggestion on how I might get a timer to work in flash so I can make a precise metronome / beat? 4dplane |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| using timer prototype: not able to use inside another function | sbhar | ActionScript 2.0 | 0 | 11-11-2005 10:39 AM |
| reset timer | blaatorx | ActionScript 1.0 (and below) | 0 | 05-19-2005 09:56 AM |
| Timer stops on frame... | sporkles | ActionScript 2.0 | 2 | 01-17-2005 06:12 PM |
| Timer Troubles | jwaller50 | ActionScript 1.0 (and below) | 4 | 01-05-2005 10:18 PM |
| Timer (help needed) | Queuer | ActionScript 1.0 (and below) | 4 | 12-08-2003 12:48 AM |