advertisement
Premier Club Log In/Registration
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   SKILLBUILDING  |   TIP BANK  |   SOURCEBANK  |   FORUMS  |   NEWSLETTERS
Browse DevX
Download the code for this article
Component Migration
Partners & Affiliates
advertisement
advertisement
advertisement
Average Rating: 5/5 | Rate this item | 3 users have rated this item.
Email this articleEmail this article
 
Master the Time-saving Power of Flash Components, Part 1
In Flash, components—drag-and-drop modules of assets and code—are frequently used to promote code reuse and conserve file size, but they're not always cross-version compatible. Find out how to build components that work across several versions of Flash. 

advertisement
ow often have you found yourself repeating the same tasks in Flash over and over? Perhaps you've recreated a logo or animation, or rewritten some simple script again and again. Wouldn't it be great if you could drag and drop a widget into your file and just have it work? With Flash components you can often do just that.


Components are self-contained units, usually comprised of graphics and code, that you can simply drop into your file to serve a specific purpose. Components can include preloaded animations, buttons, or even code-only tasks such as a timer.

You may have tried using existing Flash components or even added third-party components to your applications, but wouldn't it be ideal if you could create your own component that did exactly what you wanted it to do? This article will help you accomplish that goal.

Defining Components
For the uninitiated, MovieClips are one of the three symbol types that promote efficient reusability of Flash assets. A graphical element that begins life as a circle drawn on the stage, for example, is called a shape and might be considered a 'one-time use' asset. That is, each time that circle is used, it is essentially recreated, and contributes to file size. Converting that shape into a symbol, in this case a MovieClip, places a copy of that graphical element into the library of a Flash file. Thereafter, repeated uses of that element within the same file are, essentially, references rather than new copies. This promotes reusability, improves performance and reduces file download times.

What You Need
Components are basically self-contained, reusable combinations of MovieClips extended with the power of ActionScript. This article does not require fluency in either MovieClips or ActionScript but you may find a smoother road into the world of components if you have at least a fundamental understanding of both.

ActionScript, as the native scripting language of Flash, allows us to exert programmatic control over MovieClips, and gives developers the tools with which to create richer interactive experiences. Add the ability to reuse ActionScript, as well as graphical assets—all with drag-and-drop simplicity—and you have a Flash component.

To download the souce code for this article:

Author's Note: The material from which this article was derived will be presented in a session called "Authoring Components" at the FlashForward 2005 conference in San Francisco, April 6-8.

  Next Page: Flash Component Architecture: v1 vs. v2


Page 1: IntroductionPage 4: Steps 2, 3, and 4: Live Preview, Description, and Custom Icon
Page 2: Flash Component Architecture: v1 vs. v2Page 5: Step 5: Manually Install and Test the Component
Page 3: Steps 0 and 1: Create a MovieClip and Define Parameters 
Please rate this item (5=best)
 1  2  3  4  5
advertisement
Advertising Info  |   Member Services  |   Permissions  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers