I wrote this in about 15 minutes, so there is probably loads of mistakes.
Open up Flash and create a new document, then go to Document Properties (CTRL + J). I've made the following modifications to my document:
Once in flash create a new symbol (ctrl + 8), choose button and name it target.
Draw a circle target with the width and height of 30.0 PX.
Go back to scene 1 and drag the button "target" from the libary (Ctrl+L).
Select the button once and click actions.
Paste in this A/S:
Now select frame one, and again choose actions (if it's not already up).Code:on(press){ target._x = random ('270'); // Places randomly target._y = random ('270'); // Places randomly points++; // Increases points }
Paste this A/S in:
You now have all the needed action script. Select the target and open up properties (Ctrl + F3).Code:points='0'; // Creates variable target._x = random ('270'); // Places randomly target._y = random ('270'); // Places randomly
Under instance name type in "Target".
Now create a new layer, in this layer draw a text box in the corner.
Before clicking off of the text box open up properties and set the text to dynamic text, and the var to points.
You should now be able to play this "game" (if you can call it that). It's not really exciting, but this tutorial may help a beginner with A/S and Flash.
![]()









Reply With Quote









.
