| There are
a set of common effects you might execute in your Flash movies, such as
fading an element in or out, changing its scale, its location, visibility,
and so forth. This article covers using what I call ScriptClips to automate
simple animation using ActionScript. Then, we take it one step further and
use Flashs SmartClips to create flexible ScriptClips.
What
is a ScriptClip?
In Flash, we have Symbols with three types of fixed behaviors: Graphic,
Movie Clip, and Button. Script Clip, as a behavior, does not exist. I
use the term ScriptClip to describe a Movie Clip that contains nothing
but key frames with ActionScript. There is no other content, such as text,
shapes, or Instances. Like many Flash developers, I pick up ideas and
concepts from a variety of other developers. Credit for the idea of ScriptClips
goes out to Josh Ulm. I first picked up the idea from Josh at FlashForward2000
NYC. I believe he called them Action Clips. You can view Joshs work
and that of his company at http://www.ioresearch.com.
Instances
of ScriptClips function just like regular Movie Clips. If you drop them
on the main Timeline (or Stage if you like) or into a Symbols Timeline
the ActionScript within the ScriptClip is executed. The key advantage
of ScriptClips then is the ActionScript within them, if written to be
generic as possible, is reusable throughout your Flash movie. The key
feature of ActionScript within ScriptClips is that the script contents
must be generic, so that it can operate on a variety of Instances. Before
we build a ScriptClip, lets define our objectives for the ScriptClip
itself and detail the elements well be using the ScriptClip(s) with.
|