I have the code below. It is 2 LinkBars, each directed at a view
stack, and the view stacks are in a view stack themselves. As you can
see, in the item click events for the link bars, i am telling the
outer view stack to display the correct child view stack that
corresponds to the link bar that was clicked. One problem: if I click
a link in link bar 2, the last item clicked in link bar 1 will still
be grayed out. I want to add this code in the itemClicks:
<other-link-bar-id>.selectedIndex = -1; Unfortunately this throws this
error:
TypeError: Error #1034: Type Coercion failed: cannot convert
mx.skins.halo::[EMAIL PROTECTED] to mx.controls.Button.
at this line in LinkBar.as:
> child = Button(getChildAt(selectedIndex));
Anyone understand this?
CODE:
------
<mx:HBox>
<mx:Label text="Links:" width="100" textAlign="right"
fontWeight="bold" fontSize="13" paddingTop="2"/>
<mx:LinkBar id="detailLinks" dataProvider="{detailStack}"
itemClick="globalStack.selectedIndex = 0;" />
</mx:HBox>
<mx:HBox>
<mx:Label text="Links:" width="100" textAlign="right"
fontWeight="bold" fontSize="13" paddingTop="2"/>
<mx:LinkBar id="organizerLinks" dataProvider="{organizerStack}"
itemClick="globalStack.selectedIndex = 1;" />
</mx:HBox>
<mx:HRule width="100%"/>
<mx:ViewStack id="globalStack" width="100%" height="100%">
<mx:ViewStack id="detailStack" width="100%" height="100%" />
<mx:ViewStack id="organizerStack" width="100%" height="100%" />
</mx:ViewStack>