spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / web / dev / flash / buttons

Creating a Button

Developer News
Mandrake Linux Founder Back, Virtually
Amazon: We're a Technology Company
Sun Expands MySQL With Closed Source

Interactivity, Sound, and Curvy Motions in Flash

A button is a symbol, but it's a symbol that has special states: up, over, down, hit. You can alter the button's appearance for each state, add actions, or incorporate sound.

First, let's create a basic button. Hit F8 to start the process. Name the symbol and check the button properties box. The new screen you'll see already has the four "states" ready
Button States
Figure 15: The Four Button States
for you. (Figure 15) You'll create your button in the "up" frame. You can then create key frames in each of the other three frames so that they all start out with the same core elements. In the sample shown from Banner B, all key frames have the same red box and the words "Web Design." I've then altered the color of the box in the "Over" and "Down" states.

Be creative with your button states. You may want to shift the position of the button in the "Down" frame or change the colors of some of the states so that they appear to respond to the user's mouse. To make any changes, just move your current frame marker to the frame you want to alter and then use to arrow tool (or the arrow keys) to move it. I've adjusted this sample's "Down" state four pixels to the right and four down.

There are many ways you can work with the color of the button states. Start thinking about it, and you'll see Flash's button properties can be used to make navigational elements for a web site, the kind of coding typically done in JavaScript (but not supported evenly across the browsers). To get the color effects I've used in the "Click" button, Banner A, I've actually created separate symbols for each phase of the button so that I could adjust the colors the way I wanted. I then dropped the finished symbols into the respective key frames. At right, you can see the four button states.

The final task with the button is to add the action to the "Hit" state. In this case, the owner of MySite.com wants the viewer to go to, you guessed it, MySite.com once the button is clicked.
Action

Figure 16: Action Dialog

To add this action, click the small rectangular box next to the "Hit" key frame and select "action." From the pull-down menu, choose "Get URL," and fill in the URL and target properties. (Figure 16) Simple as that. For this example, I've coded the button to go to my own web site just so you can see the button in action.

While working on your movie, you can test button states by enabling them under Control/Enable Buttons. Now, when you preview your movie, you'll be able to see if the button states are working as you planned.

Comments are welcome

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Whitepapers and eBooks

Intel Whitepaper: Comparing Two- and Four-Socket Platforms for Server Virtualization
IBM Solutions Brief: Go Green With IBM System xTM And Intel
HP eBook: Simplifying SQL Server Management
IBM Contest: Are You the Next Superstar? Join the "Search for the XML Superstar" Contest to Find Out
Microsoft PDF: Top 10 Reasons to Move to Server Virtualization with Hyper-V
Microsoft PDF: Six Reasons Why Microsoft's Hyper-V Will Overtake Vmware
Microsoft Step-by-Step Guide: Hyper-V and Failover Clustering
Intel PDF: Quad-Core Impacts More Than the Data Center
Intel PDF: Virtualization Delivers Data Center Efficiency
Go Parallel Article: PDC 2008 in Review
Microsoft PDF: Top 11 Reasons to Upgrade to Windows Server 2008
Avaya Article: Communication-Enabled Mashups: Empowering Both Business Owners and IT
Intel Whitepaper: Building a Real-World Model to Assess Virtualization Platforms
  PDF: Intel Centrino Duo Processor Technology with Intel Core2 Duo Processor
Microsoft Article: Build and Run Virtual Machines with Hyper-V Server 2008
Go Parallel Article: Q&A with a TBB Junkie
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
IBM eBook: The Pros and Cons of Outsourcing
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
HP eBook: Guide to Storage Networking
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
webref The latest from WebReference.com Browse >
Popular JavaScript Framework Libraries: An Overview - Part 3 · Accessing Your MySQL Database from the Web with PHP · Working with the DOM Stylesheets Collection
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Crucial Triples Up With New Three-Channel DDR3 Kits · Meet the Finalists: Excellence in Technology Awards · Tealeaf Offers Insight to Mobile Customer Behavior


Created: Sep. 29, 1997
Revised: Oct. 1, 1997

URL: http://webreference.com/dev/flash/buttons.html