Adobe Dreamweaver Forums



Last 10 THreads :         FireFox displaying Search interface incorrectly (Last Post : kdeuler - Replies : 0 - Views : 1 )           »          Flash Will NOT Install - Tech Note 19166 Didn't Work (Last Post : twitterpated - Replies : 0 - Views : 1 )           »          Adobe Flash 10 kills Wimpy (Last Post : ClubEXL.com - Replies : 33 - Views : 208 )           »          Disabling flash display in Air HTML Component (Last Post : ReisenderJosh - Replies : 0 - Views : 1 )           »          repeated javascript function on same page (Last Post : aonefun - Replies : 0 - Views : 1 )           »          Live stream player (Last Post : noobie_here - Replies : 0 - Views : 1 )           »          cfloop within a cfif tag (Last Post : Azadi - Replies : 2 - Views : 3 )           »          Making constraints on a symbol... (Last Post : sirkibble2 - Replies : 0 - Views : 1 )           »          Creating a boundry in the stage... (Last Post : fazstp - Replies : 2 - Views : 3 )           »          Director or Flash? (Last Post : Sean Wilson - Replies : 1 - Views : 2 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags: , ,



Reply
  #1 (permalink)  
Old 08-28-2008, 03:15 PM
projectproofing
 
Posts: n/a
Diggs:
Default 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?



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-28-2008, 03:15 PM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Global Username Variable


"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


Reply With Quote
  #3 (permalink)  
Old 08-28-2008, 04:13 PM
projectproofing
 
Posts: n/a
Diggs:
Default Re: Global Username Variable

Thanks
Reply With Quote


  #4 (permalink)  
Old 08-28-2008, 05:43 PM
Greg Lafrance
 
Posts: n/a
Diggs:
Default Re: Global Username Variable

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.

Reply With Quote
  #5 (permalink)  
Old 08-29-2008, 12:36 AM
wyattbiker
 
Posts: n/a
Diggs:
Default Re: Global Username Variable

What you are looking for is SharObject. Its like cookies
http://livedocs.adobe.com/flex/3/langref/index.html
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 02:47 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk