Here is a simple example:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="vertical"
     creationComplete="onCreationComplete()">
     <mx:Script>
         <![CDATA[
             private var labelTimer:Timer;
             private var messages:Array = [    "This is my first
message",
                                             "This is my second message",
                                             "This is my last message"];

             private function onCreationComplete():void
             {
                 labelTimer = new Timer(5000); // 5 Seconds
                 labelTimer.addEventListener(TimerEvent.TIMER,
labelTimerTriggered);
                 labelTimer.start();
             }

             private function labelTimerTriggered(event:TimerEvent):void
             {
                 timerLabel.text = messages[labelTimer.currentCount %
messages.length];
             }
         ]]>
     </mx:Script>
     <mx:Label id="timerLabel" text="This is my first message"/>
</mx:Application>

HTH


Steve


--- In [email protected], Angelo Anolin <angelo_ano...@...>
wrote:
>
> Hi Flexcoders,
>
> I know this may sound very elementary but I cannot figure the hell out
of me how to achieve this.
>
> I have a label control.  I want to display different messages after
every 5 seconds, such as:
>
> myLabel.text = "This is my first message"
> // Need to delay for about 5 seconds here
>
> myLabel.text = "This is my second message"
> // Need to delay for about 5 seconds here
>
> myLabel.text = "This is my last message"
>
> I cannot figure out how to properly use the pause or timer utilities
in achieving this.
>
> Any idea would be appreciated.
>
> Thanks.
> Regards,
> Angelo
>

Reply via email to