1046: 找不到类型,或者它不是编译时常数: MouseEvent。
package{
import flash.display.Sprite;
import flash.events.MouseEvent;
public class Main extends Sprite
{
private var a:Sprite=new Sprite();
public function Main():void
{
a.graphics.lineStyle(2,0x0000ff);
a.graphics.beginFill(0x00ff00);
a.graphics.drawRect(0,0,100,100);
a.graphics.endFill();
a.x=50,a.y=50;
this.addChild(a);
a.addEventListener(MouseEvent.MOUSE_DOWN,an);
a.addEventListener(MouseEvent.MOUSE_UP,tai);
}
private function an(evt:MouseEvent):void{
a.startDrag(false);
}
private function tai(evt:MouseEvent):void{
a.stopDrag();
}
}
}