How to Make a Button Glow in ActionScript

How to Make a Button Glow in ActionScript thumbnail
ActionScript can make a simple button glow.

ActionScript is a programing language that allows you to develop and control a complex Flash application. ActionScript is what makes your Flash application interact with your users. It can prompt for user action, show the date and time and even take user input and process it. ActionScript enables you to make a button glow, captivating your users' attention and enticing them to click the button. Although the button is created in Flash, the ActionScript code makes it glow.

Things You'll Need

  • Adobe Flash
Show More

Instructions

    • 1

      Open Adobe Flash. A new Flash document is automatically created. Save this file and type “GlowingButton” as its name. Set the color of the background to "#000000" in the stage and set the frame rate to 24 frames per second, or fps.

    • 2

      Select the "Rectangle" tool, type "#FFCC00" for color and draw a rectangle 120 pixels wide and 30 pixels high. Select the "Selection" tool and select the upper half of your rectangle. Change the color of the selection to "#FDD535."

    • 3

      Convert the entire rectangle to a "Movie Clip" symbol and enter “golden_btn” as the name of the instance. Go to the movie's timeline by double-clicking the rectangle, select the entire rectangle and convert it to a "Movie Clip" symbol.

    • 4

      Click on frame "20" and make it a key-frame. Go to the "Filters Panel" and apply the "Glow" filter. Select "#FFCC00" as the filter color.

    • 5

      Select frame "10" and add a "Motion Tween" effect. Set the "Tween easing" to "100" in the properties panel. Select the first 20 frames, right-click them and select "Copy Frames."

    • 6

      Right-click on frame "21" and click "Paste Frames." Select the first 20 frames again, right-click on them and click "Reverse Frames."

    • 7

      Create a new layer and name it “actions.” Select frames "20" and "40" and make them key-frames. Select frames "1," "20" and "40" and open the "Actions" panel. Type "stop();" to finish the Flash button.

    • 8

      Go to the main scene and create a new layer. Name it “actions.” This will contain the ActionScript code that makes your button glow.

    • 9

      Select the new layer and open the "Actions" panel. Paste in this ActionScript code to make your button glow:

      golden_btn.mouseChildren = false;
      golden_btn.buttonMode = true;
      golden_btn.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
      golden_btn.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
      golden_btn.addEventListener(MouseEvent.CLICK, mouseClickHandler);
      function mouseOverHandler(e:MouseEvent):void{
      golden_btn.gotoAndPlay(2);
      }
      function mouseOutHandler(e:MouseEvent):void{
      golden_btn.gotoAndPlay(21);
      }
      function mouseClickHandler(e:MouseEvent):void{
      //navigating to URL on click
      navigateToURL(new URLRequest("http://flashadvanced.com"));
      }

    • 10

      Publish the Flash button and the resulting SWF file is a stylish button that glows. Use it anywhere on your Web pages.

Related Searches:

References

Resources

  • Photo Credit Comstock/Comstock/Getty Images

Comments

Related Ads

Featured