title: Is there an event that is triggered when a component is no longer displayed on the screen?
body: <p>I have a custom component I've developed that's part of a dashboard.</p>
  
  <p>It does some polling based on a timer that's part of the component.</p>
  
  <p>When the user navigates away from the view that contains this component I would like to stop the timer and hence stop the polling.</p>
  
  <p>I can obviously fire an event when the view's changed and catch it within the component but I was hoping that there might be a way to contain this all within the component.</p>
  
  <p>Is there an event or state change within a component that triggers and even when a component is currently be displayed?</p>
  
  <p>Thanks in advance for any help or suggestions!</p>
  
  <p>Example:</p>
  
  <p>
      
              
                  
  
  <pre><code>        ]]&gt;
          &lt;/mx:Script&gt;
  
          &lt;mx:TabBar x="10" y="10" dataProvider="viewstack1"&gt;
          &lt;/mx:TabBar&gt;
  
          &lt;mx:ViewStack x="0" y="0" id="viewstack1" width="675" height="315"&gt;
                  &lt;mx:Canvas label="View 1" width="100%" height="100%"&gt;
                          &lt;mx:Button x="74" y="69" label="Button 1" width="429" height="185" removedFromStage="removeFromStageEvent()"/&gt;
                  &lt;/mx:Canvas&gt;
                  &lt;mx:Canvas label="View 2" width="100%" height="100%"&gt;
                          &lt;mx:Button x="74" y="69" label="Button 2" width="429" height="185" color="red"/&gt;
                  &lt;/mx:Canvas&gt;        
          &lt;/mx:ViewStack&gt;
  
  &lt;/mx:Application&gt;
  </code></pre>