我的皮肤有点怪怪的。我希望通过触发sparks按钮按钮来解决这个问题,但我不太确定该怎么做。
这是我的按钮条形码
<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.如何访问按钮对象?
发布于 2012-03-09 06:53:15
我不确定您想要实现什么,但您可以尝试像这样更改ButtonBar.selectedIndex:
myButtons.selectedIndex = 1;如果您确实想访问按钮,请使用:
var btnBarBtn:ButtonBarButton = myButtons.dataGroup.getElementAt(0) as ButtonBarButton;或者你可以描述你的皮肤问题,也许有另一种方法解决它。
https://stackoverflow.com/questions/9625090
复制相似问题