User Guide

Creating the ActionScript class file 145
4. Define member variables. (See “Defining variables” on page 148).
These can be used in getter/setter methods.
5. Define a constructor function. (See “About the constructor function” on page 164).
6. Define an init() method. (See “Defining the init() method” on page 162).
This method is called when the class is created if the class extends UIComponent. If the
class extends MovieClip, call this method from the constructor function.
7. Define a createChildren() method. (See “Defining the createChildren() method”
on page 162).
This method is called when the class is created if the class extends UIComponent. If the
class extends MovieClip, call this method from the constructor function.
8. Define a size() method. (See “Defining the size() method” on page 165).
This method is called when the component is resized, if the class extends UIComponent.
In addition, this method is called when the component’s live preview is resized during
authoring.
9. Define a draw() method. (See “About invalidation” on page 166).
This method is called when the component is invalidated, if the class extends
UIComponent.
10. Add a Metadata tag and declaration. (See “Adding component metadata” on page 149).
Adding the tag and declaration causes getter/setter properties to appear in the Property
inspector and Component inspector in Flash.
11. Define getter/setter methods. (See “Using getter/setter methods to define parameters”
on page 148).
12. (Optional) Create variables for every skin element/linkage used in the component. (See
“About assigning skins” on page 168).
This allows users to set a different skin element by changing a parameter in
the component.