gpt4 book ai didi

apache-flex - 禁用按钮栏中的单个按钮

转载 作者:行者123 更新时间:2023-12-04 02:30:05 26 4
gpt4 key购买 nike

如何在 Flex 中禁用按钮栏中的单个按钮?

最佳答案

这是示例应用。

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="onComplete();">
<mx:Script>
<![CDATA[
import mx.controls.Button;
private function onComplete():void {
for ( var i:int=0; i<btns.numChildren; i++ ) {
if ( i == 0 || i % 2 == 0 ) {
Button(btns.getChildAt(i)).enabled = false;
}
}
}
]]>
</mx:Script>
<mx:LinkBar id="btns">
<mx:dataProvider>
<mx:ArrayCollection>
<mx:Array>
<mx:Object label="Button 1" />
<mx:Object label="Button 2" />
<mx:Object label="Button 3" />
<mx:Object label="Button 4" />
<mx:Object label="Button 5" />
<mx:Object label="Button 6" />
</mx:Array>
</mx:ArrayCollection>
</mx:dataProvider>
</mx:LinkBar>
</mx:WindowedApplication>

基本上,您可以使用

访问各个按钮
libkBarInst.getChildAt(n)

它给你一个按钮。希望对您有所帮助。

关于apache-flex - 禁用按钮栏中的单个按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1005145/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com