Editing symbol layers

Once you have created the new symbol and defined the linkages for it, you can define the component's assets in the symbol's Timeline.

A component's symbol should have two layers. This section describes what layers to insert and what to add to those layers.

For information on how to edit symbols, see Editing symbols.

To edit symbol layers:

  1. Enter symbol-editing mode.
  2. Rename an empty layer, or create a layer called Actions.
  3. In the Actions panel, add a single line that imports the component's fully qualified ActionScript class file.

    This statement relies on the Flash MX 2004 classpath settings. (For more information, see Understanding the classpath.) The following example imports the MyComponent.as file that is in the package myPackage:

    import myPackage.MyComponent;
    

    Note: Use the import statement and not the include statement when importing an ActionScript class file. Do not surround the class name or package with quotation marks.

  4. Rename an empty layer, or create a layer called Assets.

    The Assets layer includes all the assets used by this component.

  5. In the first frame, add a stop() action in the Actions panel, as the following example shows:
    stop();
    

    Do not add any graphical assets to this frame. Flash Player will stop before the second frame, in which you can add the assets.

  6. If you are extending an existing component, locate that component and any other base classes that you use, and place an instance of that symbol in your layer's second frame. To do this, select the symbol from the Components panel and drag it onto the Stage in the second frame of your component's Assets layer.

    Any asset a component uses (whether it's another component or media such as bitmaps) should have an instance placed inside the component.

  7. Add any graphical assets used by this component on the second frame of your component's Assets layer. For example, if you are creating a custom button, add the graphics that represent the button's states (up, down, and so on).
  8. When you have finished creating the symbol content, do one of the following to return to document-editing mode:
    • Click the Back button at the left side of the edit bar above the Stage.
    • Select Edit > Edit Document.
    • Click the scene name in the edit bar above the Stage.