User Guide

186 Creating Components
4. In the Component Definition dialog box, under Options, select Display in the
Components Panel.
The Tool tip text box becomes editable.
5. Enter the tooltip text for your component in the Tool tip text box.
6. Click OK to save the changes.
Component development checklist
When you design a component, use the following practices:
Keep the file size as small as possible.
Make your component as reusable as possible by generalizing functionality.
Use the RectBorder class (mx.skins.halo.RectBorder) rather than graphical elements to
draw borders around objects. (See “RectBorder class” in the Components Language
Reference.)
Use tag-based skinning.
Define the symbolName, symbolOwner, and className variables.
Assume an initial state. Because style properties are now on the object, you can set initial
settings for styles and properties so your initialization code does not have to set them
when the object is constructed, unless the user overrides the default state.
When defining the symbol, do not select the Export in First Frame option unless
absolutely necessary. Flash loads the component just before it is used in your Flash
application, so if you select this option, Flash preloads the component in the first frame of
its parent. The reason you typically do not preload the component in the first frame is for
considerations on the web: the component loads before your preloader begins, defeating
the purpose of the preloader.
Avoid multiple frame movie clips (except for the two-frame Assets layer).
Always implement init() and size() methods and call Super.init() and
Super.size() respectively, but otherwise keep them lightweight.
Avoid absolute references, such as _root.myVariable.
Use createClassObject() instead of attachMovie().
Use invalidate() and invalidateStyle() to invoke the draw() method instead of
calling
draw() explicitly.
When incorporating Flash components into your component, use their uncompiled
movie symbols located in the library of the StandardComponents.fla file from the
Configuration/ComponentFLA folder.