1 Reply Latest reply on Aug 15, 2011 6:53 AM by Manystems-Arjen

    Timer maximum delay

    Manystems-Arjen Level 1



      I have a class which calculates when a update events needs to be send.

      Sometimes this results in a large delay, for example 20 days.


      When i use this delay in a timer, the timer fires the TIMER event immediately.

      So I was wondering if there is a maximum value for the timer delay property.

      Since the delay is a number my guess was that the max numer value is also the max delay value.


      To test my issue just create a timer with delay "2572335030" and listen for the TIMER event.

      The number i "2572335030" used is a number generated by a class of mine, this is the first time i ran into this looping issue.



      Or use my example:

      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                        xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
                     private var timer:Timer;
                     [Bindable]private var timerCount:int = 0;
                     protected function btnStart_clickHandler(event:MouseEvent):void     {
                          if(parseInt(txtTime.text) < Number.MAX_VALUE){
                                    timer = new Timer(parseInt(txtTime.text));
                     private function handleTime(event:TimerEvent):void{
                          timer.delay = parseInt(txtTime.text);
                     protected function btnStop_clickHandler(event:MouseEvent):void{
                          timerCount = 0;
                <!-- Place non-visual elements (e.g., services, value objects) here -->
                <s:TextInput id="txtTime" text="2572335030"/>
                <s:Button id="btnStart" label="Start" click="btnStart_clickHandler(event)"/>
                <s:Button id="btnStop" label="Stop" click="btnStop_clickHandler(event)"/>
                <s:TextInput text="{timerCount}"/>