Newest Articles

8 Ball Pool
Photo Reel
Image Color Tinting using Actionscript
3d Rotating Image Cube
Image Slider with Easing
Catapult Game


Popular Articles

True Fullscreen Flash Mode
8 Ball Pool
FLV Player
Image Slider
Mp3 Player with XML Playlist
Album Slide


Random Articles

True Fullscreen Flash Mode
Motion along a Path
LED Text Scroller
Custom Mouse Cursor
RSS feed scroller
Show the Current Frames Per Second


Links

Foundation-Flash
Tutorial4Me
MickM
TutorialQuest
Tutorialsphere.com - Free Online Tutorials
Newgrounds
TWiT
Link to SwfSpot
Swf Spot



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
Total Views: 4216
Views in the Past 7 Days: 56


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
Add a Question or Suggestion
name:
website (optional):
captcha type the characters into the box
message (5000 characters or less):