I have 2 errors on my code right now. im making it so when you press the up key my ball goes to x.(100) and y.(200). Im having refrencing issues i think.
import fl.transitions.Tween; import fl.transitions.TweenEvent; import fl.transitions.easing.*; import flash.events.KeyboardEvent.keyCode; // two of the same errors
var xMovement:Tween; var yMovement:Tween;
function keypressed (keycode:KeyboardEvent):void { if (KeyboardEvent.keycode == 38) { // error xMovement = new Tween(tweenMC, "x", None.easeNone , tweenMC.x, x.(100) , .5, true); yMovement = new Tween(tweenMC, "y", None.easeNone , tweenMC.y, y.(200) , .5, true); } }
Could you post the exact errors you get? I don't know it from the top of my head, but I've seen my fair share of errors to know what to do occasionally.
Also, the code herofmb posted looks a whole lot better than what you first posted. You can't import the KeyboardEvent.keyCode - I believe that's only a property of a class, while you should import the class itself (KeyboardEvent).
Also, if you literally copy/pasted the code above, watch out for the function... instead of e.KeyboardEvent it should be e:KeyboardEvent, little typo there
Anyway... if you could post the errors you get now, I'll have another look!