I've run into the same problem recently while trying to make a timer
for a video player. Timer is not accurate at all and can vary greatly
depending on the interval. I agree with Fredreico, the ENTER_FRAME
event is far more reliable at producing accurate time intervals.

Jamie

On Dec 26, 2007 4:05 AM, Frederico Garcia <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
>
> arpan srivastava escreveu:
>
>  > Hi All,
>  >
>  > I have a list with many items which moves automatically by using a
>  > timer. Timer is set to 10 ms i.e. after every 10 ms second it fires an
>  > event which moves the items in the list by some distance. In IE it
>  > runs fine but in Firefox it runs very fast, i am not getting how can a
>  > timer change it's time in firfox.
>  >
>  > thanks
>  > arpan
>  >
>  > ----------------------------------------------------------
>  > Chat on a cool, new interface. No download required. Click here.
>  >
> <http://in.rd.yahoo.com/tagline_webmessenger_10/*http://in.messenger.yahoo.com/webmessengerpromo.php>
>  >
>  >
>  > __________ NOD32 2745 (20071224) Information __________
>  >
>  > This message was checked by NOD32 antivirus system.
>  > http://www.eset.com
>  The Timer is not exact, especially if fired on small intervals. If the
>  VM is not able to execute the code it jumps (like flash jumpes frames).
>  If you are trying to emulate the time frame Timer is not the best method.
>
>  Instead create a class extending MovieClip and use onEnterFrame...
>  something like this:
>
>  public class Effect extends MovieClip {
>  private var _currentFrame:uint = 0;
>  private function onEnterFrame(event:Event):void {
>  _currentFrame++;
>
>  //ADD YOUR CODE HERE
>  }
>  public function start():void {
>  this.addEventListener(Event.ENTER_FRAME,onEnterFrame);
>  }
>
>  public function end():void {
>  this.removeEventListener(Event.ENTER_FRAME,onEnterFrame);
>  }
>  }
>
>  Hope this helps.
>
>  Regards
>
>  Frederico
>  

Reply via email to