Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache flex HGroup中的Flex 4按钮状态_Apache Flex_Flex4 - Fatal编程技术网

Apache flex HGroup中的Flex 4按钮状态

Apache flex HGroup中的Flex 4按钮状态,apache-flex,flex4,Apache Flex,Flex4,我有一个HGroup,里面有一些按钮,这是我的应用程序菜单 <s:HGroup id="nav"> <s:Button id="homeButton" label="Home" /> <s:Button id="showroomButton" label="Showroom" /> <s:Button label="Catalogue" /> <s:Button label="Offers" />

我有一个HGroup,里面有一些按钮,这是我的应用程序菜单

<s:HGroup id="nav">
    <s:Button id="homeButton" label="Home" />
    <s:Button id="showroomButton" label="Showroom" />
    <s:Button label="Catalogue" />
    <s:Button label="Offers" />
    <s:Button label="My Account" />
    <s:Button label="My Orders" />
</s:HGroup>
我重置了导航按钮的状态,但不会改变按下按钮的状态

有什么想法吗


Thanx提前

您需要将按钮放置在
控件中,而不是HGroup中。

我会使用按钮栏,但我不想使用视图堆栈,而是状态。此外,我发现对ButtonBar进行蒙皮更为困难……您不仅限于对ButtonBar使用ViewStacks,还可以通过处理ButtonBar的更改事件来执行您想要的任何逻辑。为什么你觉得它们很难设计?在仔细阅读文档后,我终于明白了它是如何工作的:)Thnx
    private function resetNavState():void {
        for(var i:int = 0,ii:int = nav.numChildren-1;i<ii;i++) {
        Button(nav.getChildAt(i)).mouseEnabled = true;
        Button(nav.getChildAt(i)).skin.setCurrentState("up",true);
    }
}
protected function homeButton_clickHandler(event:MouseEvent):void
{
    resetNavState();
    currentState = "home";
    homeButton.skin.setCurrentState("over",true);
    homeButton.mouseEnabled = false;

}