Showing posts with label Buttons. Show all posts
Showing posts with label Buttons. Show all posts

Learning actionscript

Learning actionscript can be really difficult, it's just like learning another languange, a languange that allows you to communicate with Adobe Flash and tell it what to do, when to do it and how to do it. This is one of the most important skills to learn for anyone wanting to develop their skills in game making, website design and interactive pages.

Actionscript is extremely precise, 100% to be exact, so you will need to become really familar with the languange, and this is obviously achieved through constant use of actionscript, trying different things, solving code errors. Learning to solve code errors is definately a really effective way of developing your skills. It doesn't matter in the slightest if you have to Google the solution, your job is to remember the mistake, and REMEMBER THE SOLUTION!

Get to know the basics, before progressing to more advanced actionscript you should at least know some of the most basic lines of actionscript. For example, a very common line that you will use very regularly:
'gotoAndPlay(2)' - This tells Adobe Flash that you want it to go to the
second keyframe on the timeline, and play. Timeline control is definately something you need to understand, and luckily, it is really easy to pick up. This line of code doesn't really achieve much though. To make this more detailed, you could make it,
'on (release) {gotoAndPlay(2)}' - This actionscript would work perfect
with a play button.

That may only be one line of actionscript,and a very simple line, but it's a start. And in no time you should be able to memorise that and use it regularly without even thinking about it. Of course you will eventually need to use much more sophisticated actionscript, but once you have mastered the basics, this won't seem so daunting. And these tutorials will ease you in to the process.

Summary: Begin to learn actionscript and remember it, you should never copy and past, the idea is learn to write your own code, the more you type in the actionscript, the quicker and easier you will learn to write your own code!

Quote: 'When you come across a problem, find the solution, and remember the solution!'

How to make an animated button




If you aren’t familiar with making buttons, you can take a tutorial here


Begin by drawing out the shape you want to be a button, right click on it and select, ‘convert to symbol’.
Now double click on the button to enter its timeline.
Once in the button’s timeline, select the entire button, and right click on it and then go down to ‘convert to symbol’ again. This time, make sure the ‘movie clip’ radio button is checked, and then click OK.
This not change the whole button in to a movie clip, if you go back to the main timeline, flash will recognise the whole thing, as being a button still.
Now double click on the graphic you just converted in to a movie clip, to enter its timeline.
Here is where you can animate the button, notice how the timeline and frames are normal.
Animate it any way you want.
I made a button that has text on it that says ‘Click’. I inserted a keyframe at frame 10, and changed the text to ‘Here’, and inserted another keyframe at frame 20, so ‘Here’ appears for the same time as ‘Click’.
Now I have a button that say’s click, and shortly after it changes to here. This loops so my button displays it over and over.
Animate it anyway you want, that was just an idea for you, change the picture completely if you want.

Other tutorials you might like:

This tutorial has information in it to show you how to link buttons.

How to make a button



Adding a button to your game or movie
This is just for a little bit of extra knowledge.
Rename layer 1 button. Insert a oval shape on the stage. Put some text in it such as, Next or Play etc.
Now convert is to a button and name it button.
Now double click on this button to enter it timeline. I am sure you noticed a big difference in the buttons timeline, we will only be discussing the over and the down part of the timeline for now, we will further this later on in the tutorial.
Over: this simply means when the mouse is over this button. Insert a keyframe under Over, now in that keyframe change the colour of the button. Now when the user has the mouse over the button the button will change colour.
Down: this means when the mouse is down, so when the user clicks on this button. Insert a keyframe under this also, change the colour again. Now go back to the main timeline and test the movie. When the user click on this button it will change to the you put in the down section. (it will only be this colour while the mouse is down). When you have the mouse over the button it will also change to the colour that you put under the over section.

Other tutorials you might like:
Learn how to animate a button