You have several options. Perhaps the simplest is to declare
public var userid:String;
in your Application. The login popup can then access this var as
Application.application.userid and set it.
Other possibilities include a LoginInfo class with static vars (so that any
code can just access LoginInfo.userid) or a LoginInfo instance attached to your
application (so that any code can reference
Application.application.loginInfo.userid).
Gordon Smith
Adobe Flex SDK Team
From: [email protected] [mailto:[email protected]] On Behalf
Of [email protected]
Sent: Wednesday, August 05, 2009 8:19 AM
To: [email protected]
Subject: [flexcoders] How to make variables persist across application
Is there a way to have the variables I set in a pop-up window (think login),
persist and be accessible even when that pop-up is closed?
For example, I have an application that uses a pop-up login window to control
access to the application. The user supplies userid, password and role. When
the user is authenticated, the pop-up closes and a viewstack is displayed based
on the results of the role selected in the pop-up.
All that works just fine. Now, I want to display the userid in the components
within the viewstack. For example I want to display a welcome message based on
the userid.
I cant seem to figure out how to do this. Any help would be appreciated.
lee