This content has been marked as final. Show 4 replies
Application.application.myViewStack.selectedIndex = 0;
It would seem that it may be better practice to have the component dispatch an event, and then have the application listen for the event then change the view accordingly.
Thank you for your direction. If the component dispatches an event, is this considered bubbling up to the application that holds the eventlistener.
There are a few solutions to this. The general topic is about scope.
Anyway, in the MXML container the ViewStack you can write a function that can do a
myViewStack.selectedChild = <view_of_your_choice>;
This function can take your choice as a parameter.
To call that function form inside the child of the ViewStack you will need to cast the MXML containing the function you want to call.
Hope that helps.