|
|
|
[
Permlink
| « Hide
]
Peter deHaan (Adobe) - [03/04/08 03:45 PM ]
(Added related/similar bug)
As a temporary workaround, I would suggest to extend Link bar and override the clickHandler function as follow.
NOTE: I haven't test it on dataprovider other than array or viewstack. package com.fix.controls { import mx.controls.LinkBar; import mx.controls.Button; import flash.events.MouseEvent; public class ExtLinkBar extends LinkBar { public function ExtLinkBar () { super(); } override protected function clickHandler(event:MouseEvent):void { var index:int = getChildIndex(Button(event.currentTarget)); if (index == selectedIndex) hiliteSelectedNavItem(-1); else hiliteSelectedNavItem(index); super.clickHandler(event); } } } This seems like basic functionality for LinkBar, we should try to fix it in the next release. Just my 2 cents.
The problem does not stop here!
Build a project add a view stack and some canvas items. Add a HBox to the project which contains some buttons add click event handling click="vs.selectedIndex = 1;" everything works Now add an event handler to do some work prior to running the selected click event private function myHandleClick(event:Event):void { doSomething vs.selectedIndex = 1;" doSomethingElse call the event from the button click="myHandleClick(event);" the vs.selectedIndex flips (gets the last item) now how silly is that! John Clark | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||