This content has been marked as final. Show 4 replies
You said you have different MXML file acting as different "pages" - how are those files incorporated into the mainApp.mxml? Are they within a navigation container such as ViewStack or TabNavigator? They must be referenced in your mainApp.mxml file somehow or else the Flex compiler will not build them into the SWF it makes.
<mx:ViewStack id="pages" .... >
<local:homepage ... /> <!-- the index of this child is 0 -->
<local:viewRecords ... />
<local:contactPage ... /> <!-- the index of this child is 2 -->
Now your button can switch "pages" (ie, child of the ViewStack, stack) like this:
<mx:Button label="contact us" click="stack.selectedIndex=2" />
you need to bear in mind first that you're not actually going to open mxml files at runtime as they're compiled into swf files.
You can either:
use NavigatetoURL, there's an example in the help somewhere.
Use swfLoader and/or a viewStack to create 'pages' inside your main app.
Or similarly use States to create 'pages'.
All quite easy to do.
And there is also the popupManager...
Depends really whether your app needs these as external files or not.
Yes I have different MXML files acting as different pages… these pages are currently incorporated into the mainApp.mxml file using a viewStack container – although, I don’t want all of these pages to be displayed within the viewStack….
i.e. I only want for example the links: “homepage”, and “contact us” links to be in the viewstack, and for the “viewRecords.mxml” file to be accessed from a button click on the homepage etc…… - this is my problem.. Accessing files that are not initialized in the viewstack etc….
If you don't want those components displayed in the ViewStack, then where do you want them to appear? In a PopUp? You have to have them referenced in some way.