That's true. But as soon as you start adding views to a ViewStack you need to make sure, that the index matches your constant, which means you have to count through them. Counting is much harder for me than reading ;)
Cheers Ralf On Nov 23, 2007 7:24 PM, Douglas Knudsen <[EMAIL PROTECTED]> wrote: > > > > > > > > someObject.APPSTATE_LOGIN and someObject.APPSTATE_EDITUSER are fairly > self-documenting, eh? > > and selectedIndex = someObject.APPSTATE_EDITUSER is clear > > > DK > > > > On Nov 22, 2007 5:52 PM, Ralf Bokelberg < [EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > > > > > > > > I prefer String over int, because it is selfdocumenting, so i'd go for > > states rather than viewstack.selectedIndex > > Cheers > > Ralf. > > > > > > > > > > On Nov 22, 2007 1:08 PM, stephen50232 <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > > > > > > > > > Hi Seb, > > > > > > Thanks, I've now created a static const in my ModelLocator class which > > > , is called APP_DEFAULT_STATE, which I'm using to load in the > > > Application.currentState. So now I can switch between states fine, > thanks. > > > > > > One question though is Cairngorm good with managing states or is it > > > better suited to using the viewstack to manage how an application looks? > > > > > > > > > --- In [email protected], "Sebastian Zarzycki" <[EMAIL > > > PROTECTED]> > > > wrote: > > > > > > > > > > > Not really, unless you can give yourself a good explanation, why you > > > don't > > > > want to pass the value. The default logic for this behavior is a bit > too > > > > complicated (if, then). I assume your app is small, but as it grows, > you > > > > might be confused what's going on, since there is no clear > > > explanation in > > > > code, that you are switching to Login state. If your Login state is > the > > > > default one (starting), remember that you can always refer to it as > "". > > > > Create a final string APP_DEFAULT_LOGIN_STATE = "" and use this > constant > > > > even on start - this way you will know what is going on, and there is > no > > > > need to create additional check in command's logic. > > > > > > > > -----Original Message----- > > > > From: [email protected] [mailto:[EMAIL PROTECTED] > On > > > > Behalf Of stephen50232 > > > > Sent: Thursday, November 22, 2007 10:26 AM > > > > To: [email protected] > > > > Subject: [flexcoders] Re: Managing States and Cairngorm > > > > > > > > Hi Seb, > > > > > > > > Thanks for the reply, I like you idea, it makes sense. If I create an > > > > event which is fired during start up a I can in theory reuse the same > > > > event in the menu I'm creating. All it will be doing is passing the > > > > name of the state to change to. > > > > > > > > One thing I will do is when the event is fired during start up I won't > > > > pass a value for the state name, then in my Command I can check for > > > > this value and as it doesn't exist I can call the default state > > > > (Login). Do you think this is a good idea? > > > > > > > > Stephen > > > > > > > > > > > > > > > > > > > > > > -- > > Ralf Bokelberg <[EMAIL PROTECTED]> > > Flex & Flash Consultant based in Cologne/Germany > > Phone +49 (0) 221 530 15 35 > > > > > > > > -- > Douglas Knudsen > http://www.cubicleman.com > this is my signature, like it? -- Ralf Bokelberg <[EMAIL PROTECTED]> Flex & Flash Consultant based in Cologne/Germany Phone +49 (0) 221 530 15 35

