1、 匀速移动:位移=速度*时间
package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.utils.Timer;
import flash.events.TimerEvent;
import flash.text.TextField;
public class Main extends Sprite
{
public var dongTimer:Timer= new Timer(30);
public var first:TextField=new TextField();
public function Main():void
{
dongTimer.addEventListener(TimerEvent.TIMER, yidong);
first.text = "FL部落";
first.textColor = 0x000000;
addChild(first);
first.x = 50;
first.y = 250;
dongTimer.start(); ;
}
private function yidong(e:TimerEvent):void {
first.x += 10;
}
}
}
2、 到指定点的减速运动:位移=(终点-当前点)* 缓动比
package
{
package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.utils.Timer;
import flash.events.TimerEvent;
import flash.text.TextField;
public class Main extends Sprite
{
public var dongTimer:Timer= new Timer(30);
public var first:TextField=new TextField();
public function Main():void
{
dongTimer.addEventListener(TimerEvent.TIMER, yidong);
first.text = "FL部落";
first.textColor = 0x000000;
addChild(first);
first.x = 50;
first.y = 250;
dongTimer.start(); ;
}
private function yidong(e:TimerEvent):void {
first.x += 10;
}
}
}
2、 到指定点的减速运动:位移=(终点-当前点)* 缓动比
package
{