Overview of Flash ActionScript 3.0

Source: Internet
Author: User
Tags execution integer new features reference versions

It can be said that this is the first ActionScript file I translated, although AS3.0 noisy very much. However, due to the introduction of Chinese is still rare, so translated this article. This article is translated from:Http://labs.macromedia.com/wiki/index.php/ActionScript_3:overview
Because of the limited level of English and ActionScript, there may be some mistakes, and I implore the Lord and the audience to point out, but also hope to be useful to everyone.

ActionScript3.0 Overview

The evolution of ActionScript 3.0 into a powerful object-oriented programming language means a major change in the Flash platform. This change also means that ActionScript 3.0 will creatively create a rich application that adapts to the web in a creative way, making it an essential part of rich Internet applications (application) projects. The comparison of earlier versions of ActionScript has provided the power and flexibility to create a truly participatory online experience. ActionScript 3.0 will promote and develop this performance, providing the development of strong performance and comfort with advanced highly complex applications, combined with large databases as well as the ability to move the surface objects of the code. With ActionScript 3.0, developers are likely to achieve efficient performance and performance on the same platform.

ActionScript 3.0 is based on ECMAScript, and ECMAScript is an internationally standardized language for all programming languages. ActionScript 3.0 also complies with the ECMAScript language specification.

ActionScript is performed by the ActionScript virtual machine (AVM) embedded in Flash Player. AVM1, a virtual machine that executes previous versions of ActionScript, has become a more powerful flash platform today, making it possible to create interactive media and rich Web applications. AVM1, however, is squeezing the limits of the developers-their project is now at a time when it needs to change. ActionScript 3.0 brings a more efficient ActionScript execution virtual machine-avm2, which will completely reinvent the AVM1. It will mean that ActionScript 3.0 will perform at least 10 times times more efficiently than the previous ActionScript execution.

The new AVM2 virtual machine will be embedded in the Flash player8.5, which will become the first virtual machine to perform ActionScript. Of course, the old AVM1 will continue to be embedded in the Flash player8.5 to be compatible with previous ActionScript.

There are a number of products that display and apply themselves to flash Player, and the animations of these products are often applied to ActionScript to increase interactivity and behavior to show their products. In the Macromedia product family, professional designers and perhaps using ActionScript in several products, such as Macromedia Flash, Flex, and Flash media servers create content and application performance in Flash Player when In The FLEX2 product family, including the latest eclipe-Flex Builder 2 IDE, will be the first product in the series to apply the new experience of ActionScript 3.0.

The goal of ActionScript 3.0

We need ActionScript 3.0 to provide an advanced, consistent with the programming model, subject to industry standards, and the performance will be more than our past performance performance. Although ActionScript 3.0 represents a new programming model for the Flash platform, it will also be a basic object-oriented programming language for developers to be familiar with.

The advent of ActionScript3.0 will show the following objectives

Security – it supports certain security so that developers can write clear, easily maintainable code.
Simplicity-The language's intuitive level allows developers to read and write projects directly without the need for a regular reference manual
Performance-The language enables developers to write highly efficient and expressive complex projects.
Compatibility-this language discards nonstandard language standards and provides forward compatibility and meaningful alternation to conform to industry standards. ActionScript 3.0 is a normalized ActionScript 2.0 that adds ECMAScript XML applications (E4X), making the language integrated into the ECMAScript as a whole.

Features of ActionScript 3.0

ActionScript 3.0 includes two parts: the core language and the Flash Player API. The core language is used to define the structure of the programming language, such as declarations, representations, conditions, loops, and types. The Flash Player API is made up of a series of classes that precisely define Flash player functionality.

ActionScript 3.0 has the ability to dig out new features of the computer's remaining performance as much as possible. Rules represent XML that supports making operations more powerful. ECMAScript FOR XML (E4X) makes XML a universal data type and greatly simplifies XML processing. The new display LISTAPI will make the virtual objects more coherent. The normalized DOM event model makes the representations and responses of those objects more robust. Of course, these are just some of the many new experiences ActionScript3.0.

actionscript3.0 language Features

The appearance of ActionScript 3.0 is a combination of the core language aspects of ActionScript 2.0 that incorporate ECMAScript to comply with its standards and introduce new improvements in some functional areas. All of these features are described and discussed in detail in the ActionScript 3.0 language Reference, and a trial version is being Macromedia Labs. Here are some of the new features that their developers have summed up for their convenience and usage.

Enhance the ability to handle running errors

When ActionScript 2.0 was applied, many of the seemingly "flawless" run-time errors were not documented. This makes Flash Player unable to eject the dialog box that prompts the error, just as the JavaScript language did in the earlier browsers. In other words, these missing error reports make it more necessary to try to debug ActionScript 2.0 programs. ActionScript 3.0 introduces a wider range of errors that are easy to develop in compilation, and improved debugging allows for robust disposal of errors in application projects. The prompt run error provides sufficient notes (for example, the source file of the error) and a timeline with a digital cue to help developers quickly locate the wrong location.

How to handle a run error

In ActionScript 2.0, comments that run incorrectly are primarily provided to developers for help, and all help is dynamic. In ActionScript and 3.0, the information will be saved to a certain number, and Flash player will provide a time check to improve the security of the system. This information will be recorded to monitor the operation of variables on the computer so that developers can improve their application projects to reduce the use of memory.

Sealed class

ActionScript 3.0 will introduce the concept of a sealed class. Sealed classes in compile time have uniquely fixed characteristics and methods, and other features and methods cannot be added. This makes the more rigorous compile time check possible and creates robust projects. So it certainly improves the efficiency of memory use, because there is no need to add intrinsic clutter to each object instance. Of course, dynamic classes can still use a keyword as long as it is declared dynamic.

Agent mode

The more simplified event handling in ActionScript 3.0 is due to its embedded proxy approach. In ActionScript 2.0, the method closes without remembering what object cases refer to them, which can have unintended consequences when invoking a method that has been closed. The Mx.utils.Delegate class is often used, and when you use it, you write the code as follows:
Mybutton.addeventlistener ("Click", Delegate.create (this, somemethod)); Delegate.create (this, somemethod)
In AS3.0, this class no longer needs to be introduced, and automatically remembers its original object instance when the method closes. Now, you can simply write as: Mybutton.addeventlistener ("click", SomeMethod);

XML in ECMAScript (e4x)

One feature of ActionScript 3.0 is the full support of XML (E4X) in ECMAScript, and the latest specification standard for ECMA-357. E4X provides a natural, fluent language that enables the rapid construction of XML. Rather than parsing interfaces like traditional XML, e4x makes XML a universal data type. E4X simplifying the operation of XML will greatly reduce the amount of code to apply the development of the application project needs. In this site you can learn more about E4X specifications:
Www.ecma-international.org/publications/files/ECMA-ST/ECMA-357.pdf

The way of expression of the specification

ActionScript 3.0 introduces an action character (string) that supports common rules so that it can be quickly searched and quickly. ActionScript 3.0 Implementation rules are defined in the third edition of the ECMAScript Language Specification (ECMA-262).

Namespaces (namespaces)

Namespaces is an innovative new mechanism to control the visibility of declarations. Namespaces is similar to tradition by specifying types to control declarations (public, private, protected). They are essentially through a custom path, able to use the name you choose. Flex, for example, uses a mx_internal namespace for its internal data source. Namespaces use a Uniform Resource Identifier (URI) to avoid conflicts, and XML namespaces can also be used when used with e4x.

New integer type

ActionScript 2.0 defines a single-precision numeric type and a double-precision floating-point number type with number. The popular new int data type will be added to the ActionScript3.0. int is a 32-bit signed integer data type that allows the CPU to improve the ability to handle integer operations in ActionScript code, and int increases the loop operation and almost any other integer operation with no decimal point. Another new data type is uint, a unsigned 32-bit integer similar to int. UINT is mainly used in the field of table phenomenon cable color and some other int cannot work well.

Characteristics of Flash Player interface

The Flash Player API consists of a set of classes and features to enhance the ability of Flash player to accommodate the ActionScript language. This feature builds a bridge between the ActionScript core language and the free Flash platform. This will greatly improve the capabilities of the Flash application and will play an important complementary role for the core language. There is not enough room to describe the details of the API in detail, but here is a short list of new and interesting features:

(1): DOM3 Event Model
The DOM3 event model provides a standard way to generate and dispose of event messages so that objects can interact and communicate between applications, maintain state, and respond to changes. Copying the DOM3 event specification, this event model provides a clearer and more efficient mechanism for system events in earlier versions of ActionScript. The Flex program Architecture application has the same DOM3 event model as the Flash Player API, so that the system event comes to an end from the top of the flash platform.

(2): Display List API
The interface of the display (API) consists of a set of related classes that can display simple and vivid flash animations.
New (Sprite: Naughty, elf-meaning. The Flash class is a lightweight player, similar to the MovieClip class, but is more suitable for basic classes as a UI component. The new shape class replaces the old vector shape. These new classes are able to apply new ways of doing things naturally and can be more dynamic at all times than their predecessors (referring to old classes and old ways).
You no longer need to specify a depth for an object. Depth management is now automatically created in Flash Player. The new method provides the z-axis that can be specified and managed for an object.

Of course, this ActionScript 3.0 overview only outlines some of the exciting API introductions and language features. You will find more when you learn AS3.0 more deeply. When you want to learn ActionScrip3.0 how to implement Application project design <<actionscript 3.0 Programming >> a book will be a good start for you. Of course <<actionscript 3.0 Language Reference >> ActionScript 3.0 Language Reference ) is the AS3.0 core language complete description and Flash Player The authoritative information described in the API.  Of course, if you are already familiar with ActionScript 1.0 or 2.0, consult the Learning ActionScript3.0 shortcut (Tips for Learning ActionScript 3.0. ) 。

Flash Player's developer is excited to be able to deliver this language preview at the first time, with its new capabilities and improved performance performance passed through the Macromedia Lab experiment. You can smell it. ActionScript 3.0 will be brought into the Flex Builder 2,flex framework and Flash Player 8.5. I hope you will be as impressed as we are for the future of the Flash platform. And we look forward to your feedback in the experiment.

Author: Flash Player Engineering Director: Gary Grossman.
Flash Player Premium Product Manager: Emmy Huang.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.