Object
Since the introduction of the Action scripting language in Flash a few years ago, it has grown a lot. Each time a new Flash version is released, the Action scripting language adds keywords, methods, and other language elements. However, unlike previously released Flash versions, the Action scripting Language 2.0 of Flash MX 2004 and Flash MX Professional 2004 introduced new language elements to implement object-oriented programming in a more standard way, These language elements make the ability of the core Action scripting language significantly enhanced.
Action Scripting Language 2.0 is not a new language. Rather, it consists of a set of core language elements that make it easier to develop object-oriented programs. Now, because of the introduction of keywords such as classes, interfaces, extensions, and tools, it is easier for programmers familiar with other languages to learn the syntax of the Action scripting language. New programmers can learn more standard terminology that they can apply to other object-oriented languages they might want to learn in the future.
Action scripting Language 2.0 supports all the standard elements of the Action scripting language, and it completely allows you to write scripts that are closer to the standard used in other object-oriented languages such as Java. It is interesting to create an intermediate or advanced flash developer who needs to use classes and subclasses. Action Scripting Language 2.0 also lets you declare its object type when creating a variable, and does not provide a significantly improved compilation error.
The new language elements in Action Script Language 2.0 are listed below.
Class
Extends
Implements
Interface
Dynamic
Static
Public
Private
Get
Set
Import
Considerations for Action Scripting Language 2.0 include the following:
1. The script that defines a class or interface using Action Script Language 2.0 must be saved as an external script file, and each script can define only one class. In other words, you cannot define classes and interfaces in the Actions panel.
2. You can implicitly (store them at the location specified in the global or document specified search path, and then use them in the script) or explicitly (using the Import command) to import a class file. You can use wildcard characters to import packages (a collection of class files in a directory).
3. Flash 6 or later the player supports applications developed using the Action scripting Language 2.0.
4. The default publishing setting for new files created in Flash MX 2004 is the Action scripting Language 2.0. If you plan to modify an existing FLA file and use the Action scripting Language 2.0 syntax, be sure to specify the Action scripting language 2.0 in the publication settings for the FLA file. If not specified, the file will not compile correctly, although Flash will not produce a compilation error.