Flash
  Home arrow Flash arrow Page 6 - Flash 101 (Part 4): Don't Touch Me!
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
FLASH

Flash 101 (Part 4): Don't Touch Me!
By: icarus, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 16
    2001-01-10


    Table of Contents:
  • Flash 101 (Part 4): Don't Touch Me!
  • The Write Way
  • High Fidelity
  • Breaking It Down
  • Fade Out
  • The Button Man
  • Click Me

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Flash 101 (Part 4): Don't Touch Me! - The Button Man
    ( Page 6 of 7 )

    OK, enough of the Text tool. Let's move on to something else.

    Thus far, I've restricted you to creating and using graphic symbols in your Flash movies. It's time to move to the next level, with another symbol type known as a "button".

    A button, in Flash, is just like a regular symbol - you can create it, drop it into your Flash movies, and edit it - with one important difference: unlike the graphic symbols you've been creating, a Flash button comes with some pre-defined characteristics. These characteristics define the behavior of the button when a mouse pointer moves over it, or when a user clicks it.

    Let's take a look. Pop open a new Flash movie, and draw something which looks like this.



    Fill it with a gradient fill to give it that three-dimensional effect every good button needs.

    Now, select the image and convert it to a symbol. Remember to select "Button" as the symbol type this time. When you're back on the Stage, right-click the symbol and select the "Edit" option to switch to symbol-editing mode. You should see something like this on the Timeline.



    As you can see, every button comes with three pre-defined frames – "Up", "Over", and "Down" (yes, I know there's something called "Hit" as well, you can ignore it for the moment.)

    These three states allow you to specify the appearance of the button, depending on where the user's mouse pointer is. To see how this works, do the following:

    Leave the "Up" state as is - this is the state the button will appear in by default.



    Select the frame marked "Over" and right-click it to insert a new keyframe. Select the button and fill it with a different colour. This is the colour that will appear when the user's mouse pointer "hovers" over the button.



    Select the frame marked "Down", insert a new keyframe, and change the colour of the button again. If you feel like it, use the Text tool to insert a line of text under the button as well - like this:



    This is what the button will look like once a user clicks it with the mouse pointer.

    The last frame, "Hit", actually defines the "hit area" of the button symbol - this is the area that will trigger the "Over" and "Down" states when the pointer moves over it. You can define a hit area that is smaller or larger than the dimensions of your button.

    All done? Switch back to the Stage, and make sure that the Control -> Enable Simple Buttons menu item is activated - this will allow you to test the button within the Flash authoring environment itself. Now try it out - you should see something like this:



    Pretty cool, huh?

    This article copyright Melonfire 2001. All rights reserved.

     
     
    >>> More Flash Articles          >>> More By icarus, (c) Melonfire
     

       

    FLASH ARTICLES

    - An Overview of Flash and ActionScript
    - Building Web Forms In Flash
    - Building Data-Driven Flash Movies
    - Flash 101 (part 6): The Final Countdown
    - Flash 101 (part 5): Spiralling Out Of Control
    - Flash 101 (Part 4): Don't Touch Me!
    - Flash 101 (part 3): Bouncing Around





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek