package
{
import fl.controls.Button;
import fl.controls.TextInput;
public class MinRecord extends Sprite
{
private var recordBtn:Button;
private var stopBtn:Button;
private var textInput:TextInput;
...
当我运行它时报告:
Type was not found or was not a compile-time constant: Button.
Type was not found or was not a compile-time constant: TextInput.
有人能指出这里有什么问题吗?
答案 0 :(得分:2)
您是否已将TextInput
和Button
组件添加到库中?
确保您的图书馆中有。
这些应该是Flash CS5的GUI组件。
修改:我发现你还没有设置文档类或者可能没有正确
文档类是作为SWF发布时与FLA关联的顶级类。当您单击测试影片或发布时,此类的实例将生成到swf中最高级别的对象,允许访问属性和方法。
您想要取消选择主舞台上的所有对象,然后单击空白区域。然后,您将看到“属性”窗口,其中包含“文档属性”(宽度,帧速率等)。您将查找Document类框并插入actionscript文件的名称。假设您要在Main.as
中填写Main
的所有主要代码(没有.as扩展名)