14.1 Creating the Library Symbol

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin Moock
Chapter 14.  Movie Clip Subclasses and Components

Before returning to the code in Example 14-1, let's set up our movie's assets. Each movie clip subclass is associated with a movie clip symbol stored in the Library. To create instances of the subclass programmatically, we must export the symbol for use with ActionScript. Here are the steps we follow to create and export a movie clip symbol for our Ball class:

  1. Create a movie clip symbol, named ballSymbol, that contains a circle shape.

  2. In the Library, select ballSymbol.

  3. From the Library's pop-up Options menu, select Linkage. The Linkage Properties dialog box appears.

  4. Select the Export For ActionScript checkbox.

  5. In the Identifier field, type ballSymbol.

  6. Click OK.

Next, we'll create the Ball constructor function that will be invoked automatically every time an instance of ballSymbol is created.

     



    ActionScript for Flash MX. The Definitive Guide
    ActionScript for Flash MX: The Definitive Guide, Second Edition
    ISBN: 059600396X
    EAN: 2147483647
    Year: 2002
    Pages: 780
    Authors: Colin Moock

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net