ActionScript 3.0 allows you to modify class definitions using one of the following four attributes:
Attribute Definition
dynamic ------------ Allow properties to be added to instances at run time.
final ---------------- Must not be extended by another class.
internal (default) --- Visible to references inside the current package.
public ------------- Visible to references everywhere.
For each of these attributes, except for internal, you must explicitly include the attribute to get the associated behavior. For example, if you do not include the dynamic attribute when defining a class, you will not be able to add properties to a class instance at run time. You explicitly assign an attribute by placing it at the beginning of the class definition, as the following code demonstrates:
dynamic class Shape {}
Notice that the list does not include an attribute named abstract. This is because abstract classes are not supported in ActionScript 3.0. Notice also that the list does not include attributes named private and protected. These attributes have meaning only inside a class definition, and cannot be applied to classes themselves. If you do not want a class to be publicly visible outside a package, place the class inside a package and mark the class with the internal attribute. Alternatively, you can omit both the internal and public attributes, and the compiler will automatically add the internal attribute for you. If you do not want a class to be visible outside the source file in which it is defined, place the class at the bottom of your source file, below the closing curly brace of the package definition.