Here's the code for the 'Start' button, which when clicked, makes the circle visible by setting its alpha (opacity) to 100%, and moves it 100 pixels from the top and 100 pixels from the left. In ActionScript 2, you can place ActionScript for a given movie clip or button on the main timeline or attached to the movie clip itself. This example has the code attached to the button itself:
on(release) {
this.circle_mc._alpha = 100;
this.circle_mc._x = 100;
this.circle_mc._y = 100;
}
Here's the code for the circle. 'Key.RIGHT' is the right arrow key on your keyboard, so when you press the right arrow key the circle moves 6 pixels to the right. The other 3 arrow keys are handled in similar fashion:
onClipEvent(enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this._x += 6;
}
if (Key.isDown(Key.LEFT)) {
this._x -= 6;
}
if (Key.isDown(Key.UP)) {
this._y -= 6;
}
if (Key.isDown(Key.DOWN)) {
this._y += 6;
}
}