package
{
import flash.display.Sprite;
import flash.events.Event;
public class huan extends Sprite
{
var sp:Sprite=new Sprite();
public function huan()
{
yuan();
stage.addEventListener(Event.ENTER_FRAME,px)
}
function px(evt:Event):void
{
var vx:Number=(mouseX-sp.x)/8
var vy:Number=(mouseY-sp.y)/8
sp.x+=vx
sp.y+=vy
}
function yuan():void
{
sp.graphics.beginFill(0xff0000);
sp.graphics.drawCircle(0,0,21);
sp.graphics.endFill();
addChild(sp);
}
}
}
联系客服