O'Reilly logo

Professional Adobe® Flex® 3 by Joe Berkovitz, David Hassoun, Andrew Trice, Tom Sugden, Todd Prekaski, Jun Heider, Peter Ent, Joseph Balderson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required