Yes, that's exactly what I needed. It did the 'trick.' Cheers!

Manish Jethani wrote:
> 
> On 3/22/08, JRBower <[EMAIL PROTECTED]> wrote:
> 
>>  I'm trying to figure out how to un-hilite the first link in a LinkBar so
>> that
>>  no links are hilited at start up. Something like "UnSelectIndex" would
>> be
>>  great if there were such a property. I'm using Flex 3.
> 
> I assume your LinkBar is bound to a ViewStack. In that case, you can
> try this trick:
> 
>  1.  Set the data provider as an array instead of the view stack
>  2.  On the itemClick event, switch the data provider to the view stack
> 
> Example:
> 
> <?xml version="1.0"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
>   xmlns="*">
>   <mx:Script>
>     import mx.events.ItemClickEvent;
> 
>     private function handleItemClick(event:ItemClickEvent):void
>     {
>       if (lb.dataProvider != vs) {
>         lb.dataProvider = vs;
>         vs.selectedIndex = event.index;
>         vs.visible = true;
>       }
>     }
> 
>   </mx:Script>
> 
>   <mx:LinkBar id="lb" dataProvider="{['1', '2', '3']}"
>     itemClick="handleItemClick(event)" />
> 
>   <mx:ViewStack id="vs" visible="false">
>     <mx:Panel title="1" label="1" />
>     <mx:Panel title="2" label="2" />
>     <mx:Panel title="3" label="3" />
>   </mx:ViewStack>
> 
> </mx:Application>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Un-hilite-the-first-link-in-a-LinkBar-tp16218561p16235357.html
Sent from the FlexCoders mailing list archive at Nabble.com.

Reply via email to