3 Replies Latest reply on May 28, 2009 4:41 AM by *Prashant Shelke*

    display images at an interval?

    prdas_123

      hi, can u help me in how to display 5 different images at interval of 5 seconds?

        • 1. Re: display images at an interval?
          *Prashant Shelke* Level 4

          Please see following code, here you need to make more or less changes but will work..


          call initTimer()


          import flash.utils.Timer;
                      import flash.events.TimerEvent;
                     
                       private const MIN_MASK:String = "00";
                      private const SEC_MASK:String = "00";
                      private const MS_MASK:String = "000";
                      private const TIMER_INTERVAL:int = 5000;// milliseconds

           

                      private var baseTimer:int;

           

                      private var t:Timer;

           

                      public function initTimer():void {
                          t = new Timer(TIMER_INTERVAL, 5);
                          t.addEventListener(TimerEvent.TIMER, updateTimer);
                          startTimer();
                      }

           

                      public function updateTimer(evt:TimerEvent):void {
                         if(if(t.currentCount == 0)

                              image.source = "path1";

                        else if(.....) .. & so on....

                         if (cnt == 6)                stopTimer();
                      }

           

                      public function startTimer():void {
                          baseTimer = getTimer();
                          t.start();
                      }

           

                      public function stopTimer():void {
                          t.stop();
                      }

          Thanks.

          • 3. Re: display images at an interval?
            prdas_123 Level 1

            hi, thx for replying. Can u also give me the exact code for how to call when web page loads. thx in advance