![]() |
![]() |
||||||
|
|||||||
| Tags: global, username, variable |
![]() |
|
|||
|
Coming from a CF background, I have always been able to set my user's login
username in a variable scope that the entire application could reference (session). I know that in Flex/Flash there is no sessions since Flex is a persistent application. How do you set a global variable that can be used by the main application, component, and modules to help thin out data? |
| Sponsored Links |
|
|||
|
"projectproofing" <webforumsuser@macromedia.com> wrote in message news:g96a2b$pv3$1@forums.macromedia.com... > Coming from a CF background, I have always been able to set my user's > login > username in a variable scope that the entire application could reference > (session). I know that in Flex/Flash there is no sessions since Flex is a > persistent application. > > How do you set a global variable that can be used by the main application, > component, and modules to help thin out data? Google the Singleton pattern in Flex. HTH; Amy |
|
|||
|
Just create a public Boolean variable in the main MXML file that is set to
true/false depending if they are logged in or not. You can access the variable from most components using Application.application.myVarName Don't forget to import mx.core.Application in your components. Sometimes you might use parentApplication.myVarName or parentDocument.myVarName. |
|
|||
|
What you are looking for is SharObject. Its like cookies
http://livedocs.adobe.com/flex/3/langref/index.html |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise