O'Reilly logo

Essential ActionScript 3.0 by Colin Moock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Document Class

From an ActionScript perspective, a .fla file's main timeline is considered an instance of the document class, which is specified via File → Publish Settings → Flash → ActionScript Version → Settings → Document class.

The specified document class must inherit from flash.display.MovieClip if:

  • The main timeline contains any frame scripts.

  • The document class wishes to control the main timeline programmatically using MovieClip methods.

  • The main timeline's Stage contains any components with customized parameters and either of the following is true:

    • The customized parameters are not identical on all frames of the timeline. For example, a Button's label is "OK" on Frame 1 and "Submit" on Frame 2.

    • The component does not appear on all frames of the timeline. For example, a List with a custom data provider appears on Frame 1 but not on Frame 2.

  • The main timeline's Stage contains any components with customized accessibility properties or Strings Panel content.

Otherwise, the document class need only inherit from flash.display.Sprite.

Warning

When specifying the document class for a .fla file, include the fully qualified class name only; do not include the file extension (.as).

When a document class is specified, but the specified class is not found, the Flash compiler automatically generates a document class by the specified name. The automatically generated class extends MovieClip.

If a .fla file does not specify a document class, then its document class is assigned automatically. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required