Master the Time-saving Power of Flash Components, Part 2
In part 1 of this series, you learned to build components that worked with multiple versions of Flash. In this follow-up you'll learn all the little extras that allow you to customize, extend, and distribute your components, for maximum ease and peace of mind.
by Rich Shupe
February 22, 2005
n Flash, components have the power to save you a great deal of time and frustration. These pluggable, self-contained unitsconsisting of handy combinations of graphics and/or codeare just dropped into place as needed to fulfill a role in your application. You can use them over and over.
While pre-built components are often just what you need, knowing how to build your own, custom components is a skill that no one should eschew. This two-part article series is designed to show you everything you need to know to build custom components that can work in multiple versions of the Flash player.
In part 1, I covered the basic heavy-lifting of creating the component. In this follow-up, I'll show you how to really extend the usefulness of that component to get the biggest bang for the buck.
In part 1, I started with a hard-coded MovieClip. From there, the clip was converted to accept a user-defined parameter, allowing the user to modify the values of the component remotely. I then added a Live Preview file for immediate visual feedback during adjustments, a plain text description about the functionality of the component, and a custom icon.
In this article, I will:
Add a custom user interface for the component to the Properties pane
Enhance the component with a custom class when it is initialized
Make the code friendlier, and better insulated, by defining best-practices "getter" and "setter" wrappers
Use XML to enhance the Reference panel description, and add the custom actions to the Action panel
Package the component for distribution with the Extension Manager.
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.
It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com. Already a member?
To become a member of DevX.com create your Member Profile by completing the form below. Membership is free!