ActionScript 3.0 - Language Features

Learning ActionScript 3.0Image by whaleforset via Flickr

  • Run-time exceptions - Run-time exceptions are used for common error conditions, improving debugging and enabling development of applications with robust error handling Run-time exceptions provides stack traces annotated with source file and line number information and supports quick determination of error cause.
  • Run-time types - type information is preserved at run time, and used by Flash Player and Adobe AIR to perform run-time type checking, improving the system’s type safety. Type information is also used to represent variables in native machine representations, improving performance and reducing memory usage.
  • Sealed Classes - ActionScript 3.0 introduces the concept of sealed classes. A sealed class encapsulates only the fixed set of properties and methods defined at compile time; additional properties and methods cannot be added at run-time. This enables stricter compile-time checking, resulting in more robust programs. It also improves memory usage by not requiring an internal hash table for each object instance. All classes in ActionScript 3.0 are sealed by default, but can be declared to be dynamic with the dynamic keyword.
  • Method closures - ActionScript 3.0 enables a method closure to automatically remember its original object instance.
  • ECMAScript for XML (E4X) - ActionScript 3.0 implements the recent standard ECMAScript for XML (E4X). E4X offers an advanced set of language constructs for manipulating XML. Unlike traditional XML-parsing APIs, XML with E4X performs like any other native data type of the language. E4X streamlines the develpment of applications that requirs XML manipulation by significantly reducing the amount of code needed.
  • Regular expressions - ActionScript 3.0 includes native support for regular expressions enabling quick string search and manipulations. ActionScript 3.0 implements regular expressions support as defined in ECMAScript (ECMA-262) edition 3 language specification.
  • Namespaces - Namespaces are similar to access specifiers used to control visibility of declarations (public, private, protected). Namespaces are outfitted with Universal Resource Identifier (URI) to avoid naming collisions, and are also useful in representing XML namespaces while working with E4X.

    A Venn diagram of Uniform Resource Identifier ...Image via Wikipedia

  • Primitive types - ActionScript 3.0 contains the int and uint types. The int type is a 32-bit signed integer that lets ActionScript code take advantage of the fast integer math capabilities of the CPU. The int type is useful for loop counters and variables where integers are used. The uint type is an unsigned, 32-bit integer type that is useful for RGB color values, byte counts, and more.
Reblog this post [with Zemanta]

Comments

Popular posts from this blog

What is Adobe Flash ?

Prototype based programming