Apache flex 在flex中获取选定的选项卡式面板

Apache flex 在flex中获取选定的选项卡式面板,apache-flex,flex4,Apache Flex,Flex4,我在flex中有一个选项卡式面板,有各种选项卡,我使用它来获取所选的选项卡索引 private function handleInspectorAreaButtonClick(e:Event):void { var selectedIndex:int; switch(Button(e.target)) { case propertiesButton:

我在flex中有一个选项卡式面板,有各种选项卡,我使用它来获取所选的选项卡索引

private function handleInspectorAreaButtonClick(e:Event):void
        {
            var selectedIndex:int;

            switch(Button(e.target))
            {
                case propertiesButton:
                    selectedIndex = 0;
                    break;

                case dimensionsButton:
                    selectedIndex = 1;
                    break;

                case footnotesButton:
                    selectedIndex = 2;
                    break;

                case calculationsButton:
                    selectedIndex = 3;
                    break;

                case whereUsedButton:
                    selectedIndex = 4;
                    break;
            }

            inspectorAreaViewStack.selectedIndex = selectedIndex;
        }
但问题是,我并没有得到所选的选项卡索引值,所以选项卡并没有被选中。这是我选择的面板

    <s:HGroup id="inspectorAreaViewStackControls" width="100%" paddingTop="8" paddingLeft="4" paddingRight="4">
        <s:Button id="property" label="Properties" click="handleInspectorAreaButtonClick(event)"/>
        <s:Button id="distance" label="Dimensions" click="handleInspectorAreaButtonClick(event)"/>

    </s:HGroup>
这是我要更改的视图堆栈

<mx:ViewStack id="inspectorAreaViewStack" width="100%" height="100%" paddingTop="8" paddingLeft="4" paddingRight="4" selectedIndex="0" backgroundColor="0xFFFFFF">

            <s:NavigatorContent width="100%" label="propertiesContent">
                <tagInspectorAspects:PropertiesAspect id="propertiesAspect"/>
            </s:NavigatorContent>

            <s:NavigatorContent width="100%" label="dimensionsContent">
                <tagInspectorAspects:DimensionsAspect/>
                    </mx:ViewStack>

您可以使用以下特定语句

{ event.currentTarget.selectedIndex

}
事件必须是鼠标事件。

您能发布完整的代码吗?同样在switch case use case属性中:而不是case Properties Button:@rajesh.adhi我编辑了代码,这就是我所拥有的全部Librak,你找到了哪个解决方案?
<s:HGroup id="inspectorAreaViewStackControls" width="100%" paddingTop="8" paddingLeft="4" paddingRight="4">
        <s:Button id="property" label="Properties" click="handleInspectorAreaButtonClick(event)"/>
        <s:Button id="distance" label="Dim" click="handleInspectorAreaButtonClick(event)"/>
</s:HGroup>


private function handleInspectorAreaButtonClick(e:Event):void
        {
            var selectedIndex:int;

            switch(e.currentTarget.id)
            {
                case 'property':
                    selectedIndex = 0;
                    break;

                case 'distance':
                    selectedIndex = 1;
                    break;
            }

            inspectorAreaViewStack.selectedIndex = selectedIndex;
        }