I am trying to make the user move an object around the screen with the arrow keys. I created a movie clip in which I created a ball, then dragged the ball onto the main stage, given it an instance name of "ball", and added the following actionscript to Frame 1 of the main timeline.
What I told it to do is move the ball 5 pixels to whatever direction the user wants. It is supposed to work, except that it doesn't. What am I doing wrong?
you say that the code is on frame#1.
Flash will read through that code, and either move on to other code on the frame, or move onto the next frame.
You need to continually run the code to watch for keypresses so you add an onEnterFrame event around the code block. Adding the event will now run the movement code at the Frames Per Second setting of your movie.