title: force redraw on component
body: <p>I have an app w/ a login screen. When the user hits "enter", the state changes to "login" &amp; a child component is triggered to load (though the child stays invisible at the moment). The child contains many functions that the user needs upon logging in (ie their screenname &amp; settings are retrieved from a database). The following is included in 'Parent':</p>
  
  <pre><code>&lt;local:comp id="localComp" includeIn="login" includeInLayout="false" visible="false"/&gt;
  &lt;mx:Button label="login" click="currentState='login'"/&gt;
  &lt;mx:Button label="logout" click="currentState='Default'"/&gt;
  </code></pre>
  
  <p>My problem is when a user logs out (state changes to 'Default') &amp; then logs back in (state changes back to 'login') the child doesn't get "triggered" again &amp; the functions w/in the child don't reload. Is there a way to force my child to refresh? </p>
  
  <p>Note: While it would be easier to just move the child's functions to the parent it is complex...I moved these functions to the child to make it easier to follow</p>
  
  <p>UPDATE: I even tried adding an "exitState" to my state:</p>
  
  <pre><code>&lt;s:State name="login" exitState="removeElement(localComp)" /&gt; 
  </code></pre>
  
  <p>This doesn't work either, as I get an error: "RangeError: Index 0 is out of range."</p>
  
  <p>UPDATE: 
  Even though you are allowed to call a child's function from a parent, my problem is that the child needs to be "created" in order to not show errors. It makes no sense to me why the flex team would make something like removing &amp; adding children so complicated.</p>