views:

27

answers:

2

Hi,

I have a live chart. I need to refresh the chart with 5 seconds time interval.

For displaying the live chart i disptach the event (myEvent) extends cairngormevent.

And after 5 seconds , the same event has to dispatch again adn get the data to display thelie cart.

And how the event dispatch after 5 seconds with out any manula call..?

Please anyone knows, update me asap. It is very urg for me.

Thanks, ravi

A: 

User a Timer to dispatcher your event every 5 seconds.

Gregor Kiddie
I had tried with Timer and set interval 5 sec to dispatch event.But the event is not fired in 5 seconds. If have any sample code, please share me.
Ravi K Chowdary
A: 

It is working now. This is the way i dispatch the event with time interval.

         private var timer:Timer; 

            private function getChart():void
        {
    var chartEvent:ChartEvent=new ChartEvent();

                chartEvent.dispatch();

        }


         private function setTimer():void {
            timer = new Timer(5000);

            timer.addEventListener(TimerEvent.TIMER, onTimer);
            timer.start();
             CursorManager.showCursor();

         }

        private function onTimer(evt:TimerEvent):void {
            Alert.show("in");

            getChart();

            Alert.show("Dispatching Event:--->");

        }
Ravi K Chowdary