Php – Flex: Refresh a particular tab of a TabNavigator

apache-flexPHP

I am using a Tab Navigator component in which there are three canvas components. When i click one of the canvas (or tab), a Pie Chart is displayed.

Actually what happens is that on-click

1. the canvas sends an HTTPService whose url is set to a php file
2. That php file actually gets information from a database. Based on that information an xml file is created
3. Fusion Chart uses that xml file to display a pie chart

Problem:
The database is being updated after some time.

Is there any way the Pie Chart may get updated after every 3 minutes to reflect the modifications in the database? or

Can i send the particular HTTPService again and again after every 3 minutes 'in background'? or

Is there any good way to update the information in a particular canvas (or tab) of Tab Navigator?

Thanks a million. 🙂

Update:
Trying to setup a timer now in my application but i am getting following errors against 2nd and 3rd line:

2nd line error:
Multiple markers:
-1120 Access of undefined property Countsec
-1120 Access of undefined property mTimer
3rd line error:
Access of undefined property mTimer

But i have defined everything as shown below in the code:

var mTimer:Timer=new Timer(1000*60*3); //3 minutes
mTimer.addEventListener(TimerEvent.TIMER,Countsec);
mTimer.start();
private function Countsec(e:TimerEvent):void
{
 charts.send(); //HTTPService's ID that needs to be sent
}

Best Answer

The following lines need to be in a function call and not just declared in script:

mTimer.addEventListener(TimerEvent.TIMER,Countsec);
mTimer.start();

You should probably call them in a function on the initialize or the creationComplete events.

Related Topic