nets
22-02-2006, 11:15 PM
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:
http://i1.tinypic.com/oau9g3.gif
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.
http://i1.tinypic.com/oau9hy.gif
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:
on(press){
target._x = random ('270'); // Places randomly
target._y = random ('270'); // Places randomly
points++; // Increases points
}
Now select frame one, and again choose actions (if it's not already up).
Paste this A/S in:
points='0'; // Creates variable
target._x = random ('270'); // Places randomly
target._y = random ('270'); // Places randomly
You now have all the needed action script. Select the target and open up properties (Ctrl + F3).
Under instance name type in "Target".
http://i1.tinypic.com/oau9m9.gif
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.
http://i1.tinypic.com/oau9nt.gif
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.
http://i1.tinypic.com/oau9sj.gif
Open up Flash and create a new document, then go to Document Properties (CTRL + J). I've made the following modifications to my document:
http://i1.tinypic.com/oau9g3.gif
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.
http://i1.tinypic.com/oau9hy.gif
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:
on(press){
target._x = random ('270'); // Places randomly
target._y = random ('270'); // Places randomly
points++; // Increases points
}
Now select frame one, and again choose actions (if it's not already up).
Paste this A/S in:
points='0'; // Creates variable
target._x = random ('270'); // Places randomly
target._y = random ('270'); // Places randomly
You now have all the needed action script. Select the target and open up properties (Ctrl + F3).
Under instance name type in "Target".
http://i1.tinypic.com/oau9m9.gif
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.
http://i1.tinypic.com/oau9nt.gif
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.
http://i1.tinypic.com/oau9sj.gif