Newest Articles

MegaCombs
Flash Media Player
XML Driven Pie Chart
Base Defender
Hangman Game
8 Ball Pool


Popular Articles

Catapult Game
3d Rotating Image Cube
Hangman Game
8 Ball Pool
True Fullscreen Flash Mode
Base Defender


Random Articles

Flash Media Player
Catapult Game
Mouse Following Preloader
Infinitely Zooming Image
8 Ball Pool
Glowing Orb


Links

Foundation-Flash
Reddit
Newgrounds
TWiT
Link to SwfSpot
Swf Spot

Contact me on Google+



rss feed

Disappearing Button

Disappearing Button
AddThis Social Bookmark Button
Description: Creating a button that fades out on mouse over
Author: John Bezanis
Added: January 29th 2007
Version: Flash 8


Disappearing Button
Select the Rectangle Button and draw a rectangle on the stage. Select the Selection Tool and single click the rectangle. Right-click Convert to Symbol. Set the type to button and the name to buttonbutton. Single-click the newly created button and insert the following code into the Actions tab:
  1. on(press){
  2.   getURL("http://www.swfspot.com", "_self");
  3. }
Right-click the button and hit convert to symbol. Set the name to buttonmovie, the type to Movie Clip, click Export for ActionScript, and click ok. Check to see if the timeline is at Scene 1. Click the rectangle and in the Actionscript section, type the following:
  1. onClipEvent(enterFrame){
  2.   if(this.hitTest(_level0._xmouse,_level0._ymouse)){
  3.     if(this._alpha>0){
  4.       this._alpha-=5;
  5.     }
  6.   }else{
  7.     if(this._alpha<100){
  8.       this._alpha+=5;
  9.     }
  10.   }
  11. }
That's it. The source file is available below for download.

Download Source File
Comments Currently Disabled