Unlike UIComponent's states, the Viewstack default creation policy creationpolicy= "Auto", and not the Inavigatorcontent subkey until you jump to a page.
In fact, when Viewstack is addchild to the stage display list, the Initialize method is called, Viewstack creates all the Inavigatorcontent subkeys, Addchild to its own display list, The Initialize method of each subkey is called to create the subkey content, but in addition to the currently displayed subkey, the child elements of the other child containers (inavigatorcontent, MX container, and spark navigatorcontent are not created). is a container component), all child elements of the container are created until the first jump to the specified container.
Also, there are some differences between MX container and spark navigatorcontent as a specific component of the Inavigatorcontent subkey for Viewstack.
Container The Initialize event is not dispatched after the Initialize method has finished creating the content after being Viewstack addchild, Because container overrides the Initializationcomplication method (which inherits from UIComponent, the Initialize event is dispatched), the method is changed to empty.
And Navigatorcontent does not cover this method.
So, after Viewstack has created all the Inavigatorcontent subkeys at the outset, the MX container container component does not dispatch the Initialize event, but waits until the viewstack first jumps to the subkey page. The Initialize event is dispatched only after the container has created all the child element components, and the Navigatorcontent container component, when the child element component has not been created at the beginning of the Viewstack Addchild, dispatches the Initialize event, when All child element components of the Navigatorcontent container have not yet been created
Conclusion: If you want to have a subkey in Viewstack--a inavigatorcontent container component, after its container child elements have all been created, or if viewstack first goes to the container component page to do something, such as getting data from a remote server, You cannot rely on the Initialize and Creationcomplete events of the Inavigatorcontent container , because the Spark navigatorcontent container component, when dispatching initialize events, The container child element has not been created (further testing, when Spark navigatorcontent dispatches the Creationcomplete event, its child element component is still not created), the need to rewrite container or Skinnablecontainer Createdeferredcontent method , perform the required action after calling Super.createdeferredcontent
Viewstack Auto-Create subkey policy Creationpolicy