RSS link icon

.

Nice buttons easing using actionscript


In this Flash tutorial you will see how to use actionscript to make a nice button click effect, (as you might notice I just started using AS3 instead of AS2) just so you know.

 

 

The first thing is to make a nice smooth button, you can use an image or just draw something, I made a simple button using the rectangle tool, and added a drop shadow filter.

 

actionscript button animation effect

 

Right click your button and convert it to a movie clip, in the properties panel give your button and instance name, I just called mine btn_1.

 

actionscript button animation effect

 

Now hit F9 to go to the actionscript panel, (not having any movie clip selected if you are using AS3).

 

Type in the following code, I put in some comments in gray which should help you understand the code better if needed.

 

actionscript button animation effect

 

Thats it, try to run your flash project, you should have a button like mine, and if you click it, your should "jump" back and forth.



Admin Bob says: 2008-03-08

try to tell me what error message you get, I might be able to help you.

zack says: 2008-03-03

hey i keep having problems every single time i type exactly what you type and is says "error" (i didnChr(34)t type in comments)

Admin Bob says: 2008-02-20

Hi Ruiqi, I might have misunderstand your problem, but What I think might be wrong is your stage width is not enough. If thats not the problem, try to explain again.

StupidSaint says: 2008-02-17

This is a nice tut... keep up the good work.

Ruiqi says: 2008-02-16

My button keeps moving to the left edge of the screen, no matter where I place it on stage. Can you help me

panamadream says: 2008-02-13

very useful code.tnx!good tutorial

samivel says: 2008-01-24

very good tutorials