thanks for any help you can provide
I want a movieclip to move left or right with easing so I am using flash's tween .The code is below. Problem I am face is that when I am clicking left key it moves on once rather than to keep moving while i keep pressing the key and same with right key. Some help please? Thanks.
//variable declarations
var Currpos:Number = boat_mc.x ;
var xleft:Number = boat_mc.x - 40;
var xright:Number = boat_mc.x + 40;
// move boat
stage.addEventListener(KeyboardEvent.KEY_DOWN,onKeyboardClick);
function onKeyboardClick (e:KeyboardEvent):void{
if (e.keyCode == Keyboard.LEFT){
var tweenleft:Tween = new Tween(boat_mc, "x", Regular.easeOut, Currpos, xleft, 2, true);
}
if (e.keyCode == Keyboard.RIGHT){
var tweenright:Tween = new Tween(boat_mc, "x", Regular.easeOut, Currpos, xright, 2, true);
}
}