I have a custom component, I designed this part of the panel.
It performs some timer-based polls, which are part of the component.
When the user moves from the view containing this component, I would like to stop the timer and therefore stop the polling.
I can obviously fire an event when the view has changed and catch it inside the component, but I was hoping there might be a way to contain it all inside the component.
Is there an event or a state change inside the component that is triggered even when the component is currently displayed?
Thanks in advance for any help or suggestions!
Example:
]]> </mx:Script> <mx:TabBar x="10" y="10" dataProvider="viewstack1"> </mx:TabBar> <mx:ViewStack x="0" y="0" id="viewstack1" width="675" height="315"> <mx:Canvas label="View 1" width="100%" height="100%"> <mx:Button x="74" y="69" label="Button 1" width="429" height="185" removedFromStage="removeFromStageEvent()"/> </mx:Canvas> <mx:Canvas label="View 2" width="100%" height="100%"> <mx:Button x="74" y="69" label="Button 2" width="429" height="185" color="red"/> </mx:Canvas> </mx:ViewStack> </mx:Application>
source share