Thanks all - since the whole app is pretty much built at runtime from an
xml template, and each gui component knows its identity from its
encapsulated xml node, I wanted to pick up some efficiency by not having
to parse the data providers continually ... but you made me think :-) 
and I am going to save the tab bar and viewstack indexes within the xml
nodes, so e.g. drilling on a chart axis can change a tab by index rather
than by trying to translate the tab label from the xml node.


--- In [email protected], "Josh McDonald" <[EMAIL PROTECTED]> wrote:
>
> Use this:
>
>
http://flex.joshmcdonald.info/2008/10/selecting-right-value-from-combobo\
x-or.html
>
> -Josh
>
> On Mon, Nov 3, 2008 at 4:45 AM, Tracy Spratt [EMAIL PROTECTED] wrote:
>
> >  That seems like a complicated and difficult way to do it.
> >
> >
> >
> > Why not just loop over tabArray, comparing your value to tabLabel,
and when
> > you match, use that loop index to set the selected index.
> >
> >
> >
> > Tracy
> >
> >
> >  ------------------------------
> >
> > *From:* [email protected]
[mailto:[EMAIL PROTECTED] *On
> > Behalf Of *Mic
> > *Sent:* Sunday, November 02, 2008 12:54 PM
> > *To:* [email protected]
> > *Subject:* [flexcoders] Re: change selected tab using variable
containing
> > tab label string?
> >
> >
> >
> > Tried that - I think :-)
> >
> > public function createTabList():void {
> > for each (var node:XML in _paraSightDataset.tab) {
> > var newItem:Object = new Object();
> > newItem.tabLabel = [EMAIL PROTECTED] <node.%40label.toString>();
> > newItem.name = newItem.tabLabel;
> > tabArray.addItem(newItem);
> > }
> >
> > myTabBar.dataProvider = tabArray;
> >
> > }
> >
> > private function
> >
traceDisplayList(container:DisplayObjectContainer,indentString:String =
> > ""):void
> > {
> > var child:DisplayObject;
> > for (var i:uint=0; i < container.numChildren; i++)
> > {
> > child = container.getChildAt(i);
> > trace(indentString, child, child.name);
> > if (container.getChildAt(i) is DisplayObjectContainer)
> > {
> > traceDisplayList(DisplayObjectContainer(child),
> > indentString + " ")
> > }
> > }
> > }
> >
> > traceDisplayList(myTabBar);
> >
> > parasight0.appPanel.appBox.HBox29.myTabBar.Tab84 Tab84
> > parasight0.appPanel.appBox.HBox29.myTabBar.Tab84.upSkin upSkin
> > parasight0.appPanel.appBox.HBox29.myTabBar.Tab84.selectedUpSkin
> > selectedUpSkin
> > parasight0.appPanel.appBox.HBox29.myTabBar.Tab84.UITextField85
> > UITextField85
> > parasight0.appPanel.appBox.HBox29.myTabBar.Tab86 Tab86
> > parasight0.appPanel.appBox.HBox29.myTabBar.Tab86.upSkin upSkin
> > parasight0.appPanel.appBox.HBox29.myTabBar.Tab86.UITextField87
> > UITextField87
> > parasight0.appPanel.appBox.HBox29.myTabBar.Tab88 Tab88
> > parasight0.appPanel.appBox.HBox29.myTabBar.Tab88.upSkin upSkin
> > parasight0.appPanel.appBox.HBox29.myTabBar.Tab88.overSkin overSkin
> > parasight0.appPanel.appBox.HBox29.myTabBar.Tab88.UITextField89
> > UITextField89
> > parasight0.appPanel.appBox.HBox29.myTabBar.Tab90 Tab90
> > parasight0.appPanel.appBox.HBox29.myTabBar.Tab90.upSkin upSkin
> > parasight0.appPanel.appBox.HBox29.myTabBar.Tab90.UITextField91
> > UITextField91
> > parasight0.appPanel.appBox.HBox29.myTabBar.Tab92 Tab92
> > parasight0.appPanel.appBox.HBox29.myTabBar.Tab92.upSkin upSkin
> > parasight0.appPanel.appBox.HBox29.myTabBar.Tab92.UITextField93
> > UITextField93
> >
> > So childName is set internally? Wonder how one would even use
> > myTabBar.getChildByName()? Maybe I am missing something? TIA,
> >
> > Mic
> >
> > --- In [email protected] <flexcoders%40yahoogroups.com>,
"Ralf
> > Bokelberg" ralf.bokelberg@
> > wrote:
> > >
> > > Maybe you can add name="{label}" to the children?
> > >
> > > Ralf.
> > >
> > > On Sun, Nov 2, 2008 at 11:20 AM, Mic chigwell23@ wrote:
> > > > myTabBar.selectedIndex =
> > > > myTabBar.getChildIndex(myTabBar.getChildByName(e.label)); does
not
> > > > work because the child name is not the tab label text. How would
I
> > do
> > > > this? TIA,
> > > >
> > > > Mic.
> > > >
> > > >
> > >
> >
> >
> >
>
>
>
> --
> "Therefore, send not to know For whom the bell tolls. It tolls for
thee."
>
> Like the cut of my jib? Check out my Flex blog!
>
> :: Josh 'G-Funk' McDonald
> :: 0437 221 380 :: [EMAIL PROTECTED]
> :: http://flex.joshmcdonald.info/
> :: http://twitter.com/sophistifunk
>


Reply via email to