【发布时间】:2011-07-22 11:59:12
【问题描述】:
我正在尝试从这样的函数中向 Flex 4 应用程序中的组添加一个按钮;
public function addButton(myID:Number):void {
var myButton:Button = new Button();
myButton.id = ObjectUtil.toString(myID);
myButton.label = "New Button "+myButton.id;
myButton.click= textAlerter(myID);
myGroup3.addElement(myButton);
}
添加了标签和 id 属性,但没有添加点击。 错误消息说 click 是 spark.components:Button 的未定义属性。 但是像这样添加到组中时它是一个属性;
我做错了什么?
【问题讨论】:
标签: apache-flex button components