In my Application I have a ViewStack. The ViewStack has 2 children:
SplashBox and MainBox. SplashBox has a VBox, which has an Accordion,
which has two children, LoginBox and AccountCreateBox.
In MainBox I trigger a logoutEvent by clicking a button. Among other
things, I want to clear the fields in LoginBox as a result of this
event. The only way that I have found to do this is to have an init()
function in LoginBox that is called on creationComplete and looks like
this:
private function init():void{
parent.parent.parent.parent.parent.addEventListener("logoutEvent",clearFields);
}
This seems inelegant and awkward. If I make any changes in my
structure, I'm going to have to remember to change the init function
as well.
Is there a better way?
TIA!
LG