magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 2001 > 08 > Design Feature  

Elastic Navigation with ActionScript

By Branden J. Hall

Web designers often gravitate toward Flash 5 because it lets you create navigational elements that are impossible to achieve with plain old HTML. Flash is well suited to this task, but most designers don't tap into my favorite part of Flash: ActionScript! I'm not talking about the simple stop-and-play actions that I'm sure you're familiar with; I'm talking about real math-based code. Yes, I said the M-word, and it gets worse. The math we'll be using is based on a subject most of us haven't thought about since high school—physics. Now, stop shaking in your boots so we can get started. It's not as scary as you think.

Motion Sense

First, let's learn how to make movie clips move with code. Start off by opening Flash and making a new, blank movie. Then, draw a circle on the stage and select it. We want to convert this shape into a movie clip symbol. Do so by either selecting Insert, Convert to Symbol or by pressing F8. Name the symbol MyCircle, and make it a movie clip. With our new movie clip selected, open the Actions panel. If the Actions panel isn't set to Expert mode, set it now (the setting is located in the arrow menu at the top right of the panel). In normal mode you have to pick your actions from the menu on the left and then fill in some blanks. In Expert mode you have to type everything yourself. Forcing yourself to use Expert mode will make you a better coder; you'll end up learning the language much faster. The code we'll attach to this movie clip is known as a clip event. This type of code block can only be attached to movie clip instances.




  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2