And if your conponents are not intended for use in other apps, you can
type the variable as the application name and get type checking and code
hinting.

private var _appMain:MyMainAppMxmlFileName = Application.application;

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Paul Andrews
Sent: Friday, September 26, 2008 7:49 AM
To: [email protected]
Subject: Re: [flexcoders] Quick reference to Application.application

 


----- Original Message ----- 
From: "itdanny2002" <[EMAIL PROTECTED]
<mailto:Chow.Danny%40gmail.com> >
To: <[email protected] <mailto:flexcoders%40yahoogroups.com> >
Sent: Friday, September 26, 2008 11:50 AM
Subject: [flexcoders] Quick reference to Application.application

>I have main application and many modules.
> While I do the coding in modules, I need
> to Application.application for refering
> to variable and functions in Main application.
> All works but I want to type shorted name.
> Any methods ?

Quick and dirty - in your code declare: var a:Object = 
Application.application;

It won't make your code very readable and there are better ways to go
about 
things - for example using a singleton class to hold 'global' variables 
rather than refering to variables declared in the main application.

http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails
&productId=2&postId=262
<http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetail
s&productId=2&postId=262> 

Paul. 

 

Reply via email to