For a change as significant as that, I suggest using ViewStack instead of
states.

 

Tracy Spratt,

Lariat Services, development services available

  _____  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Penny Laus
Sent: Saturday, January 23, 2010 1:22 AM
To: flexcoders@yahoogroups.com
Subject: [SPAM] [flexcoders] TabNavigator switches to second tab when
revealed after a currentState change

 

  

I've run into a funny problem in a registration application I'm
working on. The base state for this application is a TabNavigator with
three Canvas subelements. On its own, this works fine.

When the application loads, I switch away from the base state to a
screen to let the user login/get their password emailed/add a new
registration. If they want to add a new registration, currentState is
set back to "" to return to the base state - the full data entry form.

The funny part is that when the state changes, the selectedIndex of
the TabNavigator switches from 0 to 1. I've stepped through in the
debugger and before this line the (hidden) TabNavigator has an index
of 0.

this.currentState = ""; // Base state has input form

After this line, the TabNavigator has an index of 1.

If I explicitly reset the selectedIndex back to 0, the TabNavigator is
drawn with elements from the first two "pages" drawn on top of each
other. I can see that the Canvas for index 0 is drawn and the Canvas
for index 1 is drawn on top of that.

I've tried using a ViewStack instead of TabNavigator but, as you would
expect, it makes no difference.

I've been going around in circles for some time here without any
progress - is this problem ringing a bell? I didn't find anything like
it in the archives. I've tried with the 3.2 and 3.5 SDKs but the
behavior is the same in both cases.

I could skip the TabNavigator completely and do everything with
ViewStates but, honestly, I'd rather not. I find it simpler to work
with the TabNavigator in the visual designer. Then again, if it isn't
going to work right it's not really "eaiser" any more.

Thanks in advance for any help or suggestions.



Reply via email to