Flex Flash Builder 4 - SDK 4.0 - Windows
Short Version Question: What is the "state" of a child within a ViewStack after it has been created but while it is not currently the selectedChild? Is there an event dispatched when that child becomes the selectedChild other than the change event on the ViewStack itself. One would think the show() event would do this, but apparently if a component is not the selected, that does not mean it is hidden (not visible).
The problem here is that I want to call a function within the child components of the viewstack every time they are selected. The first time the child is selected, I can use the creationComplete event. But every time after that, I can't find an event that dispatches "Hey, I am now the selectedChild!". If I use the change event on the ViewStack, that will work everytime after the first time, but causes an error the first time because the child has not completed creating yet when the function is called.
I have gotten around this before by creating a boolean variable for each child set to true after creation, then checking that var before sending the function call, but that seems really convoluted, and there just must be an easier way that I am missing.
Set the ViewStack.creationPolicy = "all". This will force creation all of the members of the stack rather than creating them on-demand (selection). Then listen for the ViewStack.change event.