【发布时间】:2014-04-19 22:09:55
【问题描述】:
按钮和文本框尚未动态添加。
我有一个实例名称为 slot1 的影片剪辑。
在 slot1 内,我有一个名为 newBtn1 的按钮。
在新的 Btn1 中,我有一个动态文本框,名称为 text 1。
slot1.newBtn1.text1.text = "Button";
//这段代码给我一个错误
try
{
slot1.newBtn1.text1.text = "New Game";
}
catch (err:Error)
{
trace(err);
}
slot1.newBtn1.addEventListener(MouseEvent.CLICK, chooceCharacter)
这是下面的错误
ReferenceError: Error #1069: Property text1 not found on flash.display.SimpleButton and there is no default value.
我很确定这在 As2 中可以工作,但 As3 是严格的。
我正在使用 Flash CC 和 Flash Develop 来编写代码。
【问题讨论】:
标签: actionscript-3 flash