ActionScript 2.0 Syntax Guidelines

laborermaizeΛογισμικό & κατασκευή λογ/κού

4 Ιουλ 2012 (πριν από 4 χρόνια και 9 μήνες)

305 εμφανίσεις

ActionScript 2.0 Ov
er
vie
w

The Flash pr
ogramming language

“F
eels” a lot lik
e Ja
va or Ja
vaScript

Actions

Built-in librar
y

Custom classes
Syntax Guidelines

Comments — ignor
ed b
y Flash,
meant f
or the

de
v
eloper
:
indicated b
y
“//” or
“/* */”

Statements — separated b
y
“;”

Assignment — use
“”

Pr
oper
ties —
“dot notation”

Blocks — delimited b
y
“{
!
}”

V
ariables — pr
eceded b
y
“var”

Functions/methods —
“(
!
)” delimits arguments;

“{
!
}”

delimits body
Actions

Small scripts attached to assor
ted Flash

objects,
typicall
y frames

Con
v
ention:
frame-based actions liv
e in a

la
y
er called
“Actions” — ex
ecuted when

mo
vie r
eaches that frame

Access named instances (symbols,
others),

set pr
oper
ties,
in
v
ok
e a
vailable methods
Built-In Librar
y

Classes:
mo
vie clips,
buttons,
text objects,

and man
y mor
e

“Globals” — accessible an
ywher
e
,

an
ytime
,
including functions (commands),

pr
oper
ties

Beha
viors:
canned actions,
autogenerated

b
y Flash based on user input
Custom Classes

Mak
e y
our o
wn objects with y
our o
wn

pr
oper
ties

By con
v
ention,
defi
ned in
ActionScript fi
les

(AS) with the class name

Can cr
eate completel
y ne
w class or

extend existing ones

Public vs.
private access

Constructor
:
function that cr
eates an

instance of a class

Pr
oper
ties:
internal variables that diff
er

among instances — the
y r
efl
ect the
state

of an instance

Methods:
actions that ha
v
e access to

pr
oper
ties — the
y r
efl
ect an instance’
s

behavior