Hi, Im trying to get this code to work … The idea is the when I press the “w” key, the MC will move up Y_axis and when I **release **the “w” key the MC eases a little bit further …
Can anyone help …:)?
the MC(walker) code:
onClipEvent (load) {
speed = 2;
dist = 100;
var keylistener:Object = new Object();
Key.addListener(keylistener);
keylistener.onKeyUp = function(){
switch(Key.getAscii(119)){
case Key.UP :
new mx.transitions.Tween(this,"_y",mx.transitions.easing.Strong.easeOut,this._y,(this._y-dist),3,true);
break;
case Key.DOWN :
this.moveT("_y", -speed);
break;
}
}
}
The keyframe code:
MovieClip.prototype.moveT = function(point, amount) {
this[point] += amount;
walker[point] += amount;
};