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

Picture as Button

30.7.2006, 20:14    Total views: 45338
Have you ever seen the button that seems like a picture? Exactly this tutorial will show you how to create advanced flash button using a picture and Action Script.You will also learn how to import any picture in flash, how to convert it into a Movie Clip Symbol, how to apply action script code on that picture and more.






Example:






Step 1

Open a new flash document. Open the Document Properties dialog (CTRL+J) and set Width to 120 and Height to 90px. Frame rate set to 30fps (Frames per second).



Step 2


Press Ctrl+R on the keyboard (Import to Stage) and import any picture.



Step 3

Select that picture and press F8 on the keyborad (Convert to Symbol). In Convert to Symbol window under Behavior (Type - flash8) choose a Movie Clip and press Ok. Look at the picture below!



Step 4

Double click on a new made Movie Clip or press right click and choose Edit in Place.



Step 5

While your picture is still selected, press again F8 on the keyboard (Convert to symbol), and under Behavior (Type - flash8) choose Graphic.

#ads#



Step 6

Click on the fifteenth frame and press F6. After that select the picture, go back on the first frame, open the Properties Panel (Ctrl+F3), under Color choose alpha and set it to 15%. Look at the pictures below!





Step 7

While your Properties Panel is still open, select the layer 1, and in the Properties Panel under Tween choose Motion.





Step 8

Insert a new layer above layer 1 and name it Action.



Step 9

Click on the fifteenth frame and press F7 (Blank keyframe).



Step 10

While you're still on the fifteenth frame, open the Action Script Panel (F9) and paste this script:

stop ();

Step 11

Go back on the first frame of layer Action, open the Action Script Panel again (F9), and paste this script:

stop ();

this.onEnterFrame = function(){
if(rewind == true){
prevFrame();
}
}

this.onRollOver = function(){
rewind = false;
play();
}


this.onRollOut = function(){
rewind = true;
}

this.onRelease = function(){
getURL("http://www.flashvault.net");
}

Test your movie (Ctrl+Enter).
 
We're done!

 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: 225065

2. Water effect
Total views: 169137

3. Photo slide show
Total views: 156961

4. High-tech city animation
Total views: 154359

5. Special Picture Effect
Total views: 148419

Related links