首页 > 未分类 > 飞机移动缓动类,深藏于心的精华
2019
12-06

飞机移动缓动类,深藏于心的精华

//舞台上增加一个mc,实例名:jiba
stage.addEventListener(Event.ENTER_FRAME,enter_frameHandler);
stage.addEventListener(MouseEvent.CLICK,clickHandler);

var sx:Number = 0;
var sy:Number = 0;

function clickHandler(evt:MouseEvent):void

 sx = evt.stageX;
 sy = evt.stageY;
 trace("click:" + sx + "," + sy);
 
 
}

var juliX:Number = 0;
var juliY:Number = 0;

function enter_frameHandler(evt:Event):void
{
 juliX = sx - jiba.x;
 jiba.x = jiba.x + juliX/3;
 
 juliY = sy - jiba.y;
 jiba.y = jiba.y + juliY/3; 
 
}

 

 

最后编辑:
作者:搬运工