I have one application mxml and two modules mxml. In the application mxml i'm just using the moduleLoader with the url property to load the first module. First module is having viewStack. From this module i'm able to load the another module by setting the event click as click="viewStack.selectedChild=dS" and moduleloader as <mx:ModuleLoader id="dS" url="dataSource.swf" width="100%" height="100%"/>.
Here, from one module to another module is working fine but when i press the back button from module2 so that i can come back to module1, its not working. i have putted the following code under the click event of button as click="parentApplication.viewStack.selectedChild=parentApplication.panelSqlServi ce".
I am also pasting the code snippet.
Simple Application MXML
<?xml version="1.0" encoding="utf-8"?>
//Fix for flex history manager
private var hist:HistoryManager;
private var drg:DragManager;
private var erMsg:ErrorMessage;
<mx:ModuleLoader url="sqlService.swf" width="100%" height="100%"/>
Here i'm just loading the module1.
First Module Code(sqlService.swf)
<mx:ViewStack id="viewStack" width="50%" height="70%">
<mx:LinkButton icon="@Embed(source='../resources/add.png')" toolTip="Data Source" id="newActionLnk" paddingTop="5" click="viewStack.selectedChild=dS"/>
<mx:ModuleLoader id="dS" url="dataSource.swf" width="100%" height="100%"/>
From here, i am able to go to Second Module.
Second Module Code(dataSource.swf)
<mx:Button id="back" label="Back" click="parentApplication.viewStack.selectedChild=parentApplication.panelSqlService"/>
Here when press the back, i get the error and not able to go back to first module screen.
Please help me in solving this problem.
When you say it is not working, what do you mean? Are you getting an error? Rather than use parentDocumednt, you could use mx.core.Application.application or parentDocument, but often it is even better to use custom events. You might have to add the event listeners for the custom events to the systemManager. Popups are not in the same display list as the application, so listening at the systemManager level is often necessary, because it is in the same display list.
These links may help answer your question:
If this post answers your question or helps, please mark it as such.
I'm attaching the error image which i am getting when i press the back button. Basically i want to see the previous screen(navigation between these 2 modules) as normal screen, no popup stuff.
error.JPG 20.2 K