Flash tutorials
Home 3D (2) Actionscripting (66) Animation (108) Audio (4) Drawing (7) Full flash sites (4) Getting Started (15) Navigation (25) Special Effects (61) Text Effects (38)

Interactive icon button using the AS

23.6.2009, 18:4    Total views: 23751

We are going to learn how to create interactive icon button using the action script code and some special flash tips and tricks. You can use this button for some web site, or for some flash menu. Using this lesson, you will also learn how to import any icon into a flash stage, how to convert it into a Movie Clip Symbol, how to create instance name, invisible button and much much more!


Step 1

First, find any icon which you like to use for this lesson. You can also, if you like, save my icon below.

Step 2

Create a new flash document. Press Ctrl+J key on the keyboard (Document Properties) and set the dimensions of your document as whatever you like. Select any color as background color. Set your Flash movie's frame rate to 32 and click ok.

Step 3

Call the current layer icon. Double-click on its default name (Layer 1) to change it. Press Enter once you have typed in the new name!

Step 4

Choose now File > Import > Import to stage (Ctrl+R) and import any icon into a flash stage.

Step 5

While the icon is still selected, hit F8 key (Convert to Symbol) to convert it into a Movie Clip Symbol.

Step 6

While the new made Movie Clip is still selected, go to the Properties Panel below the stage. On the left side, You will find the Instance name input field there. Call this Movie Clip icon. See the picture below!

Step 7

Double-click on the movie clip on stage with the Selection tool(V).You should now be inside the Movie Clip.

Step 8

While the icon is still selected, hit again F8 key (Convert to Symbol) to convert it again into a Movie Clip Symbol.

Step 9

Click now on frame 10 and hit F6 key. While you're still on frame 10, move your icon a little left.

Step 10

After that, select the Selection Tool (V) and click once on the icon to select it. After that, go to the Properties Panel (Ctrl+F3) below the stage! Then, select Filters tab from the left side. Click after that on the plus icon and select the Bevel filter. Make the adjustments as follows:

Step 11

Right-click anywhere on the gray area between the two keyframes on the timeline and choose Create Motion Tween from the menu that appear.

Step 12

Go back on the main scene (Scene 1).

Step 13

Create a new layer above the layer icon and name it Invisible Button.

Step 14

Select now the invisible button layer and take the Rectangle Tool (R). In the Colors portion of the Tool panel, block the Stroke color by clicking on the little pencil icon and then on the small square with the red diagonal line. For Fill color choose any color and draw the Invisible Button over the icon. See the picture below!

Step 15

Select now the Selection Tool (V), click once on the Invisible Button to select it, open the Action Script Panel (F9) and enter the following Action Script code, inside the Actions panel:

on (rollOver) {
_root.mouse_over_icon = true;

on (rollOut) {
_root.mouse_over_icon = fstartlse;

on (release){

Step 16

Create a new layer above the Invisible Button layer and name it action. Then, click on the first frame of layer action and enter the following Action Script code inside the Actions panel:

_root.icon.onEnterFrame = function() {
if (mouse_over_icon) {
} else {

We're done now!

Test your movie and enjoy!

Download source file (.fla)

Have questions about this tutorial?
Visit our friendly Community Forums!
Digg it! Add this tutorial to del.icio.us! Furl it! Add this tutorial to reddit! Spurl it! Add this tutorial to technorati!

Top tutorials

1. Advanced full flash site - Part 1
Total views: 310977

2. High-tech city animation
Total views: 274205

3. Water effect
Total views: 237451

4. Photo slide show
Total views: 221126

5. Special Picture Effect
Total views: 190885

Related links

dans le cadre de leur collection automne / hiver 2008 de la ngc, marque japonaise a ainsi une fois de plus a porter.ADIDAS TUBULAR WOMENils ont travaillé sur l'ensemble des trois pieces et # 8211; un sac fourre - tout, une valise et un porte - clés / carte de voyage.ils présentent une gamme de produits classiques.le fait qu'elles offrent a la plupart d'entre eux en orange est un bon contraste.  via honeyee.ADIDAS ORIGINALS NMDon peut s'attendre a une libération de ce produit dans les semaines a venir.ADIDAS TUBULAR SCHUHEla broderie artiste kimberly scola est parmi ceux qui participent a ce los angeles & # 8216; & # 8220; cette fete et # 8221; exposition,ADIDAS YEEZY BOOST 550 inaugurée vendredi dernier.ADIDAS EQUIPMENT 10a l'occasion de l'ouverture, en cas de scola a collaboré avec une tapisserie de 100 faux sacs fourre - tout.Adidas Adizero F50 FGces agréables rappels d'un événement,ADIDAS X PLR malheureusement, seulement deux jours de liaison.ADIDAS MESSI 16.3 ICles points saillants de & # 8220;StartAdidas Ultra Boost Uncaged cette fete et # 8221; et une liste de cas suivent l'artiste.ADIDAS ACE 16.3 TF