1046:未找到类型或不是编译时常量错误

时间:2014-01-08 08:55:29

标签: actionscript-3

我对AS3非常非常新,并尝试编辑我的一些模板。我收到这条消息...... 有人可以帮我一步一步做些什么吗?就像我说的,我很新,需要一步一步。

Scene 1, Layer 'Layer 2', Frame 1, Line 10  1046: Type was not found or was not a compile-time constant: Event.

Scene 1, Layer 'Layer 2', Frame 1, Line 23  1046: Type was not found or was not a compile-time constant: MouseEvent.

Scene 1, Layer 'Layer 2', Frame 1, Line 28  1046: Type was not found or was not a compile-time constant: MouseEvent.

Scene 1, Layer 'Layer 2', Frame 1, Line 33  1046: Type was not found or was not a compile-time constant: MouseEvent.

Scene 1, Layer 'Layer 2', Frame 1, Line 38  1046: Type was not found or was not a compile-time constant: MouseEvent.

2 个答案:

答案 0 :(得分:5)

不会导入您在代码中引用的类。

import flash.events.Event;
import flash.events.MouseEvent;

答案 1 :(得分:1)

您需要先导入这些类,然后才能使用它们(有关详细信息,请参阅Curtis Morley's post

将以下内容添加到文档顶部:

import flash.events.*