Xml – Flex MSML components

apache-flexmxml

I want to load a MSML component from another MSML component in Flex. To be more specific, I have a Login MSML component that loads from my main Application file and a Overview MSML component. When a user clicks on some button from that Login component it should redirect to the load Overview MSML component in place of Login component.

Best Answer

I'd use viewstack

<mx:ViewStack width="100%" height="100%" id="viewstack">
  <local:LoginControl/>
  <local:OverviewControl/>
</mx:ViewStack>

This will show login page by default. Set viewstack.selectedIndex = 1; in the click handler of the button to hide login control and display overview.

Related Topic