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 schoolphysics. 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.