Flash 5: ScriptClips & SmartClips
September 07, 2001
by: Robert Ross
rob@trainingtools.com
User Level - Intermediate 
 
  Download Printable in FullSite

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 Flash’s 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 Josh’s 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 Symbol’s 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, let’s define our objectives for the ScriptClip itself and detail the elements we’ll be using the ScriptClip(s) with.


What is a Script File? Objective
Building the Script File Using the Script File
Added Flexibility: Using Smart Clips Creating a SmartClip
Using a ScriptClip Conclusion