dispatch an event from the component
Ok I've got the custom event working to changes states. How do I close/remove the child component from the parent?
I tried removeChild and removeElement, but got errors:
<local:CreateItem id="createItemComponent" includeIn="CreateItem" itemCreated="createItemComponent_itemCreatedHandler(event)" />
protected function createItemComponent_itemCreatedHandler(event:Event):void
didnt it get removed when you changed state?
It's visibly gone, but it's still there. If I go back into the child compenent there's a form thats filled with all the data entered previously.
use the addedToStage event in the component to reset the form values