Chapter 3. ActionScript 3.0 Fundamentals

In the previous chapter, you saw how Flex is a development toolkit, a development framework, an IDE, and a way of architecting rich Internet applications targeted at the Flash platform. The Flex framework is built upon the Flash Player APIs, which are in turn built upon the ActionScript 3.0 language. ActionScript 3.0 is an imperative, true inheritance-based, strongly typed object-oriented (OOP) language that conforms to the ECMA-262 Edition 4 (or ES4) draft standard (www.ecmascript.org/es4/spec/overview.pdf).

This chapter takes a condensed look at the following aspects of the ActionScript language:

  • Core language concepts

  • Control structures

  • Data types

  • Object-oriented programming

  • ActionScript 3.0 best practices

Core Language Concepts

To begin describing a language and expose its methodologies, one must begin with a discussion of three core concepts:

  • Basic syntax

  • Reserved keywords

  • Variables and data types

Basic Syntax

The following syntax defines the way that ActionScript is written:

  • Type declaration — All variables and properties are usually typed, identified by a colon (:) after the identifier, followed by the data type or class object:

    var myVar:Number;
  • Case sensitivity — Identifiers of the same name but of different case are considered to be different. For example, the two following variables are considered to be different properties:

    var myVar:String;
    var myvar:String;
  • Dot syntax — When properties and methods are accessed, inheritance, display object, and ...

Get Professional Adobe® Flex® 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.