Thanks for your reply, sorry for not replying sooner, but I had to return to work unexpected.
Quote:
|
1) You have the main application that loads in / holds multiple modules.
|
Yes, an application which works on around 14 levels and has between 70 to 80 modules.
Quote:
|
2) Not all the modules are visible at once ( maybe they are in a view stack or something ).
|
Yes, all levels are operating within ViewStacks, but they are several levels active at one time layered and actively working.
Quote:
|
3) Modules have buttons inside of them that once clicked, should communicate with the main application (or the container holding the currently clicked module ) and depending on the event, the container/application should hide/show a new module.
|
No not quiet! there is only one button available and that is the one I like to work with and have not been able as yet. There are more buttons are available but they work on some of the levels and do not address or inter-communicate with the ‘parentApplication’ only on there own levels! Not even to or in between the modules.
There are only two of the modules in total which are used by the ‘parentApplication’ to get to the rest.
Quote:
|
I have no idea what you understand by "to programmatically click a btn" Do you want to simulate the click event without the user actually clicking a button? ( I already described how this should be handled in my previous reply ).
|
I just mean by programmatically: ‘Code’ not by clicking the button. And yes that is what I would like to do ‘Simulate the Click of a button’ or exchange text strings between modules or child module to the level carrier-module (parent).
Here is some code which I used reasoned, and which I got working between sub-module (child) and level carrier-module (it’s parent).
Nothing else seems to work what I have tried over time. No other code between modules or sub-module (child) and level carrier-module (parent).
Thanks in advance aktell
Code:
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical">
<mx:Script>
<![CDATA[
private var myModCom:Object;
private function moduleComHandler():void {
myModCom = moduleLoader.child as Object;
myModCom.addEventListener( "submit", submitHandler );
}
private function submitHandler( evt:Event ):void {
textI1.visible = false;
}
]]>
</mx:Script>
<mx:ModuleLoader
id="moduleLoader"
url="ContactEntry.swf"
ready="moduleComHandler();"/>
<mx:TextInput id="textI1"/>
</mx:Application>
Code:
<mx:Module
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
width="100%" height="100%">
<mx:Metadata>
[Event(name="submit", type="flash.events.Event")]
</mx:Metadata>
<mx:Script>
<![CDATA[
public static const SUBMIT:String = "submit";
private function submitHandler():void {
dispatchEvent( new Event(SUBMIT));
}
]]>
</mx:Script>
<mx:Button label="submit" click="submitHandler();"/>
</mx:Module>