Apache flex HGroup中的Flex 4按钮状态
我有一个HGroup,里面有一些按钮,这是我的应用程序菜单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" />
<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;
}