我正在尝试将我的.as文件链接到我的Flash程序。以下是我的.as文件中的代码:
package com.project {
import flash.display.Sprite;
import flash.events.*;
public class Program extends Sprite{
public var value:Number;
private var max:Number;
private var min:Number;
function draggable()
{
min = bar_mc.y;
max = bar_mc.height - Erhu_H3_btn.height;
Erhu_H3_btn.addEventListener(MouseEvent.MOUSE_DOWN, dragHandle);
}
function dragHandle(event:MouseEvent):void
{
Erhu_H3_btn.startDrag(false, new Rectangle(0,min,0,max));
stage.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
}
function stopDragging(event:MouseEvent):void
{
Erhu_H3_btn.stopDrag();
stage.removeEventListener(MouseEvent.MOUSE_UP, stopDragging);
}
}
}
以下是我的Flash文件中的代码:
import com.script.Script;
stop();
var Program:Program = new Program();
有人可以告诉我我做错了什么吗?我一直收到错误1046!谢谢! :)
答案 0 :(得分:0)
您可能错过了导入声明
import com.project.Program