Defining a collection property

You define a collection property by using the Collection tag in a component's ActionScript file. For more information, see About the Collection tag.

NOTE

 

This section assumes that you know how to create components and inspectable component properties.

To define a collection property:

  1. Create a FLA file for your component. See Creating a component movie clip.
  2. Create an ActionScript class. See Creating the ActionScript class file.
  3. In the ActionScript class, insert a Collection metadata tag. For more information, see About the Collection tag.
  4. Define get and set methods for the collection in the component's ActionScript file.
  5. Add the utilities classes to your FLA file by selecting Window > Common Libraries > Classes and dragging UtilsClasses into the component's library.

    UtilsClasses contains the mx.utils.* package for the Collection interface.

    NOTE

     

    Because UtilsClasses is associated with the FLA file, not the ActionScript class, Flash throws compiler errors when you check syntax while viewing the component's ActionScript class.

  6. Code a class that contains the collection item properties.

    See Defining the class for a collection item.


Flash CS3


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00002528.html