I'm using this code to move my character:
TweenMax.defaultEase = Linear.easeNone;
onEnterFrame = function() {
if (Key.isDown(39) && !moving) {
moving = true;
TweenMax.to(char, .5, {_x:"50", onComplete:function(){moving=false;}});
TweenMax.to(char.barrier, .5, {_rotation:"90"});
}
if (Key.isDown(37) && !moving) {
moving = true;
TweenMax.to(char, .5, {_x:"-50", onComplete:function(){moving=false;}});
TweenMax.to(char.barrier, .5, {_rotation:"-90"});
}
}
When I keep arrow pressed, character moves quite smoothly, but sometimes stops for a fraction of second. Is there something wrong with my code or something else is causing this (increasing frame rate hepled a bit, but animation is still not perfectly smooth)?