shaunak
Tux Fan
Flash: Create your very own game
Create a quick and messy Flash game.
First start off by creating a button. To do this you need a basic shape. I take a circle, a yellow circle.
Now to convert this to a button you neer to declare it as a symbol. to to that select the graphic and press F8. I named by button "target". You can also do this by following this path: Insert>convert to symbol
*img462.imageshack.us/img462/9649/tut1ug8.th.jpg
Choose symbol type as "button" an confirm.
Now double click you new button to enter this screen:
*img462.imageshack.us/img462/7481/tut2do3.th.jpg
You will see that the button has 4 states. up, over down and hit. Each state is for each type of conditions of input the button can encounter.
Up: normal state of the button
Over: mouse over condition
Down: clicked button
Hit: Area along in which the button is active and will work. Not visible if rendered scene. usefull for creating invisible buttons, or buttons that work even if you click slightly outside.
I will modify the button states a little so that the user knows if he has clicked it or not.
*img462.imageshack.us/img462/192/tut3hq7.th.jpg *img462.imageshack.us/img462/2737/tut4cu2.th.jpg *img462.imageshack.us/img462/522/tut5dc3.th.jpg.
To do this click on the white box below each state and press F6 [right click> insert keyframe]
Then modify the button as you like i have just changed colours and added a small animation. leave the hit area as it is.
Now go back to the main screen by clicking the scene 1 button :
*img462.imageshack.us/img462/9606/tut6qb5.th.jpg
Lets add a score board. Add a layer [i havent in the screen shot because i plan to move it to another layer later] then simply create a text box and type in a 0 [zero]. Modify its size and font using the charecter box. If the box isnt showing by default the add it using: windows>panels>charecter. [Or CTRL T]
*img462.imageshack.us/img462/9566/tutmidbm9.th.jpg
Now to make the score "updatable" go to the charecter box and click on "text options". Change the text type from "static" to "dynamic text" as shown:
*img462.imageshack.us/img462/5673/tutshowro5.th.jpg
As soon as you do that you will get entry box to enter the variable name. Assign it any variable name you like. we will use this later to change the text depending on the users clicks. Imm calling it "score".
*img462.imageshack.us/img462/5863/tutmid2ky0.th.jpg
Create a quick and messy Flash game.
First start off by creating a button. To do this you need a basic shape. I take a circle, a yellow circle.
Now to convert this to a button you neer to declare it as a symbol. to to that select the graphic and press F8. I named by button "target". You can also do this by following this path: Insert>convert to symbol
*img462.imageshack.us/img462/9649/tut1ug8.th.jpg
Choose symbol type as "button" an confirm.
Now double click you new button to enter this screen:
*img462.imageshack.us/img462/7481/tut2do3.th.jpg
You will see that the button has 4 states. up, over down and hit. Each state is for each type of conditions of input the button can encounter.
Up: normal state of the button
Over: mouse over condition
Down: clicked button
Hit: Area along in which the button is active and will work. Not visible if rendered scene. usefull for creating invisible buttons, or buttons that work even if you click slightly outside.
I will modify the button states a little so that the user knows if he has clicked it or not.
*img462.imageshack.us/img462/192/tut3hq7.th.jpg *img462.imageshack.us/img462/2737/tut4cu2.th.jpg *img462.imageshack.us/img462/522/tut5dc3.th.jpg.
To do this click on the white box below each state and press F6 [right click> insert keyframe]
Then modify the button as you like i have just changed colours and added a small animation. leave the hit area as it is.
Now go back to the main screen by clicking the scene 1 button :
*img462.imageshack.us/img462/9606/tut6qb5.th.jpg
Lets add a score board. Add a layer [i havent in the screen shot because i plan to move it to another layer later] then simply create a text box and type in a 0 [zero]. Modify its size and font using the charecter box. If the box isnt showing by default the add it using: windows>panels>charecter. [Or CTRL T]
*img462.imageshack.us/img462/9566/tutmidbm9.th.jpg
Now to make the score "updatable" go to the charecter box and click on "text options". Change the text type from "static" to "dynamic text" as shown:
*img462.imageshack.us/img462/5673/tutshowro5.th.jpg
As soon as you do that you will get entry box to enter the variable name. Assign it any variable name you like. we will use this later to change the text depending on the users clicks. Imm calling it "score".
*img462.imageshack.us/img462/5863/tutmid2ky0.th.jpg
Last edited: