You declare them as public outside a function in your app root and then
set their values in a function that is triggered off of the
application's creationComplete event. Pseudocode:
<mx:Application creationComplete="initVars()">
<mx:Script>
public var x:myVarX;
public var y:myVarY;
public function initVars():void {
// set values here
}
</mx:Script>
Hth,
Matthew J. Horn
Flex docs
> -----Original Message-----
> From: [email protected]
> [mailto:[EMAIL PROTECTED] On Behalf Of Alexander Tsoukias
> Sent: Friday, April 07, 2006 8:16 PM
> To: [email protected]
> Subject: [flexcoders] BETA 2: Setting global Vars at creationComplete
>
> Hi all,
>
> Simple question which I can't seem to find in the help section either.
>
> I want to set some variables on creationComplete of my app so
> that I can access them from anywhere in the rest of the
> application later on or even change them as the user logs in
> for example.
>
> I'm a coldfusion expert, not an actionsript fan, but I'm
> starting to like it very much, so bare with me on this one.
>
> Thanks,
> Alex
>
>
>
>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/