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

Conclusion
The examples above are very simple, but you can take the principles and build on them. For example, you could build a single ScriptClip that handles fade-ins, fade-outs, and rotation for example. Basically, anything you need to achieve. In the examples above, the loop is infinite, meaning the alpha property continues to increment by whatever value you’ve specified, even beyond 100%. Though this might not really take up much processing power, I like to be more efficient. In the second key frame I’d modify the script to make the loop stop when appropriate:

if (_parent._alpha>=100) {
stop();
} else {
gotoAndPlay(1);
}

This script has a condition, to check if the alpha property of the parent Timeline is greater than or equal to 100. If the condition is true, the scrub (or Playhead) will stop on Frame 2. If the condition is false, the loop continues.


Robert Ross is a courseware developer for TrainingTools.com. He is also a full-time instructor at XtraNet in Toronto, Canada. He has been developing multimedia, video, animation, and web projects for 5 years. He is the author of many TrainingTools Learning manuals, including Learning Flash 5, Learning Dreamweaver 4 (with Charlie Walker), Learning Photoshop 6 (with Charlie Walker) and others.


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