单击触发器按钮栏



我的皮肤发生了一件奇怪的事情。我希望通过触发火花按钮来解决这个问题,但我不确定该怎么做。

这是我的按钮条形码

<s:ButtonBar id="tabs" dataProvider="{vs}"
             skinClass="skins.hatchedbuttonbarskins.TabBarSkin" 
             depth="100" width="80%" visible="true" 
             bottom="0" horizontalCenter="0" height="25" />
<mx:ViewStack id="vs" width="95%" height="625" 
              borderVisible="true" horizontalCenter="0">
    <s:NavigatorContent width="80%" height="100%" 
                        label="My Label" 
                        skinClass="skins.lg.TabNavigatorContent">
        <lists:ListCenter myLists="{this}" myButtons="{tabs}"/>
    </s:NavigatorContent>
...

在此之后还有三个navigatorcontent对象。

在ListCenter.mxml中,我想触发选项卡按钮栏按钮的单击。这是我正在做的动作脚本调用。

myButtons[1].dispatchEvent(new MouseEvent(MouseEvent.CLICK));

它给了我以下错误:

Error #1069: Property 1 not found on spark.components.ButtonBar and there is no default value.

如何访问按钮对象?

我不确定你想要实现什么,但你可以尝试像这样更改ButtonBar.selectedIndex:

myButtons.selectedIndex = 1;

如果你真的想访问按钮,那么使用:

var btnBarBtn:ButtonBarButton = myButtons.dataGroup.getElementAt(0) as ButtonBarButton;

或者你可以描述你的皮肤问题,也许有另一种方法可以解决它。

最新更新