as3中的包错误
package {
import flash.display.Sprite;
import flash.utils.*;
public class SetTimeoutExample extends Sprite {
private var delay:Number = 1000; // delay before calling myDelayedFunction
public function SetTimeoutExample() {
var intervalId:uint = setTimeout(myDelayedFunction, delay, "Hello", "World");
}
public function myDelayedFunction():void {
trace(arguments[0] + " " + arguments[1]);
}
}
}
我收到一个关于包的错误,这段代码有什么问题?谢谢
package {
import flash.display.Sprite;
import flash.utils.*;
public class SetTimeoutExample extends Sprite {
private var delay:Number = 1000; // delay before calling myDelayedFunction
public function SetTimeoutExample() {
var intervalId:uint = setTimeout(myDelayedFunction, delay, "Hello", "World");
}
public function myDelayedFunction():void {
trace(arguments[0] + " " + arguments[1]);
}
}
}
i take an error about package what is wrong in this code?thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要创建一个名为
SetTimeoutExample.as
的新文件,并将代码放入其中。确保该文件与player.fla
位于同一目录中。然后打开player.fla,并在属性窗口(“窗口”>“属性”)中,将“Class”字段设置为SetTimeoutExample
(不带.as)。You need to create a new file called
SetTimeoutExample.as
, and put the code in there. Make sure that the file is in the same directory asplayer.fla
. Then open player.fla, and in the properties window (Window > Properties), set the "Class" field toSetTimeoutExample
(without the .as).