setInterval causes the Frame to execute the "moveobject" function every 50 milliseconds. The "moveobject" function checks if one of the arrow keys
is pressed and then moves the Sprite1 object accordingly.
Hit F9 for preview. Click anywhere inside to animation so it will be activated and start taking key strokes.