Typically a modules-based app must have one mx:Application.  If that app has 
the properties you want shared, you can access them from the modules as 
Application.application

Otherwise, you might need a singleton class that the modules reference.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: [email protected] [mailto:[email protected]] On Behalf 
Of ramu,chinna
Sent: Tuesday, October 06, 2009 11:12 AM
To: [email protected]
Subject: [flexcoders] Converting Flex Applications to Modules



Hi all,

We are planning to convert our mx:applications to mx:modules for performance, 
integrity, usability reasons.

In each of our applications we heavily use Application.application to refer 
Application variables.

AppOne.mxml
------------
<mx:Application ....>
<mx:Script>
<![CDATA[
public var isApprovedUser:Boolean = false
]]>
</mx:Script>
......
<mx:workLoadComp id="wlComp"/>
......
</mx:Application>

workLoadComp.mxml
---------------------
<mx:Canvas ...>
<mx:Script>
<![CDATA[
//Check is Approved User
if(Application.application.isApprovedUser){
//Some logic
}
]]>
</mx:Script>
</mx:Canvas>

Now we would like to convert AppOne.mxml into mx:Module. Is there any way we 
can just replace all Application.application references to point Module 
reference. What is the best way to deal this?

Thanks in advance.

Reply via email to