Thanks Jim, I'll check out the Tab Navigator component - I wasn't sure what the differences were. So using that component, switching to a different state is still the same way I had it I guess eh? I'll have to check my data again to find out why it's failing. yeah, the textfield was just to show what the values were on screen for debugging. That part is working fine and showing the correct values. Thanks!
Jason Merrill Bank of America Learning & Organizational Effectiveness ________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jim Robson Sent: Wednesday, January 10, 2007 8:14 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: basic architecture question Hi Jason, This syntax looks correct... > currentState = targetComp.dataProvider[event.index].data; ... as long as targetComp.dataProvider[event.index].data gives the name of the state that you want. I noticed that you output this to a text field, so I assume that it's correct. So it's the usual check-for-empty-spaces-and-stuff-like-that. Another method is to use a TabNavigator in place of a Tab Bar, and use custom components for the individual tabs. Something like this: <mx:TabNavigator> <jx:CustomComponent1 label="First Tab" /> <jx:CustomComponent2 label="Second Tab" /> <jx:CustomComponent3 label="Third Tab" /> </mx:TabNavigator> Or you could re-use the same component with different data for each tab: <mx:TabNavigator> <jx:CustomComponent1 label="First Tab" dataObject="{myArrayCollection.getItemAt(0)}" /> <jx:CustomComponent1 label="Second Tab" dataObject="{myArrayCollection.getItemAt(1)}" /> <jx:CustomComponent1 label="Third Tab" dataObject="{myArrayCollection.getItemAt(2)}" /> </mx:TabNavigator> Either way, a nice thing about using the TabNavigator approach is that the Flash player doesn't load the contents of a tab into memory until the user clicks on the tab. This helps the app load faster, and saves client resources generally. I'm not sure if this also applies to states. -Jim --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> , "Merrill, Jason" <[EMAIL PROTECTED]> wrote: > > Thanks everyone for your help and ideas. Very useful. I have something > working now, but not with a custom component, though Jim I will try out > your ideas there. > > My next architecture question has to do with states and navigation. I > have a TabBar I am trying to use to navigate between different states - > different pages in my application which all look very different except > the navigation piece. Is this the best way to handle switching between > different screens? I was able to render the TabBar based on my data > bindings without a problem, and I can register the event that the tab > was clicked, but i was unable to get it to change states. I tried: > > private function tabClick(event:ItemClickEvent):void { > var targetComp:TabBar = TabBar(event.currentTarget); > forClick.text="label is: " + event.label + " index is: " + > event.index + " capital is: " + > targetComp.dataProvider[event.index].data; > currentState = targetComp.dataProvider[event.index].data; > } > > Where .data is the name of the state I want to change to. What is the > proper approach? Thanks! > > > Jason Merrill > Bank of America > Learning & Organizational Effectiveness >