开发者

as3 tween position relative to current position

开发者 https://www.devze.com 2022-12-17 18:01 出处:网络
I have a tween set on a timer: var manTimer:Timer = new Timer(1000,14); manTimer.addEventListener(TimerEvent.TIMER, moveMan);

I have a tween set on a timer:

var manTimer:Timer = new Timer(1000,14);
manTimer.addEventListener(TimerEvent.TIMER, moveMan);
function moveMan(e:TimerEvent):void {
    var manX:Tween = new Tween(man, "x", Regular.easeOut, 0, -40, 1,开发者_Go百科 true);
}

I just need to make the tween's position relative to it's current position, as opposed to starting at the stage's 0 position then moving the the stage's -40 position. It needs to start at its current position the move -40 from that position.

Thanks, Wade


var manX:Tween = new Tween(man, "x", Regular.easeOut, man.x, man.x - 40, 1, true);

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号