We're looking at porting a large Flash 8 application to Flex
2. Some of FlexBuilder's features make some things that took a long
time very easy, but on the other hand, some simple things are
turning into a pain in Flex,
We have an actionscript file that sets default values for
several _global variables that are accessed throughout the
We have a login function that changes the value of some of
these global variables when a person logs in.
What used to be a simple assignment of _global.userName =
userData.Firstname; is no longer possible
because _global no longer exists and we can't figure out how
to make it work, and if its going to require
a lot of recoding to replace what was previously a 1 line
In trying to accomplish what should be an easy task, we made
a start.mxml which has 2 states,
"notloggedin" which is the default state, and a "loggedIn"
The notloggedin state displays a login.mxml component which
contains a processLogin function which should
change a couple of global variables and then it changes the
state to "loggedIn" which displays the main.mxml
component which should display some of the global variables
that were changed in the login.mxml component.
We cannot seem to set any variables as global.
We've tried the class thing...
public class myClass
static public var sGlobals:Object = new Object();
We import myClass in the main applicaiton
In the login function we set a value...
myClass.sGlobals["userName"] = "testing";
but when myClass.sGlobals.userName or
myClass.sGlobals["userName'] is called, it shows nothing.
If you know how to do this, can you actually post some
2. login.mxml with a function that changes global variable
3. main.mxml displaying global variables
4. if another file is necessary to accomplish this
And your solution was...??? The whole point of these forums
is to share info. If you post a problem and solve it you should
still share the answer because if you had this problem then other
people, like me, will have it too!!!