将Timer添加到Object as3

时间:2013-12-26 04:59:02

标签: actionscript-3

如何在as3 flash professional cs5中为对象添加一个Timer?

var s={};
s.WTACH:Timer = new Timer(1);

此代码产生错误:

1078: Label must be a simple identifier.

1 个答案:

答案 0 :(得分:2)

您的申报存在问题。试试这个:

var s = {};
var temp:Timer = new Timer(1);
s.WATCH = temp;