Chapter 3: Actionscript Language And Syntax; Language Overview - Adobe FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 Manual

Programming actionscript 3.0
Table of Contents

Advertisement

CHAPTER 3
3
ActionScript Language
and Syntax
ActionScript 3.0 comprises both the core ActionScript language and the Flash Player
Application Programming Interface (API). The core language is the part of ActionScript that
implements the draft ECMAScript (ECMA-262), Edition 4 draft language specification. The
Flash Player API provides programmatic access to Flash Player.
This chapter provides a brief introduction to the core ActionScript language and syntax. After
reading this chapter, you should have a basic understanding of how to work with data types
and variables, how to use proper syntax, and how to control the flow of data in your program.
Contents
Language overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Objects and classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Packages and namespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71
Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Conditionals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Looping. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

Language overview

Objects lie at the heart of the ActionScript 3.0 language-they are its fundamental building
blocks. Every variable you declare, every function you write, and every class instance you
create is an object. You can think of an ActionScript 3.0 program as a group of objects that
carry out tasks, respond to events, and communicate with one another.
35

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents