You are on page 1of 44

ActionScript 3.

0 ECMAScript
1-4 ActionScript
4 ActionScript Adobe Flash Player 9

5-10 ActionScript
ActionScript 3.0 ECMAScript
3.0
11-26 Flash Player Adobe Flash Player 9

API

ActionScript
ActionScript
ActionScript Flash Player ActionScript (AVM) ActionScript
""
Adobe Flash CS3 Professional
Adobe Flex Builder Adobe Flex SDK Flex Data Services
SWF SWF Flash Player
ActionScript 3.0
ActionScript AVM2
ECMAScript (ECMA 262)

(API)
ECMAScript (ECMA-262) 4
ECMAScript for XML (E4X) ECMA-357 2 XML APIE4X ECMAScript
XML
(DOM) 3



"" ActionScript

""

ActionScript 3.0



ActionScript "" var
Adobe Flash CS3 Professional
""Flash
ActionScript

-1-


ActionScript
""""
String
Numeric numeric ActionScript 3.0
o Number
o Int
o Uint""
Boolean true false
ActionScript

MovieClip
TextField
SimpleButton
Date
""
""
myVariable Number
myVariable Number
myVariable Number
myVariable Number



ActionScript

""
(.) ""
"--"

""
""

""ActionScript

""
ActionScript
"" Flash Player

ActionScript

-2-

function eventResponse(eventObject:EventType):void
{
//
}
eventSource.addEventListener(EventType.EVENT_NAME, eventResponse);

addEventListener() ""

""

eventResponse
eventObject
ActionScript

({ ...})

addEventListener()
addEventListener() addEventListener()

myButton

function eventResponse(event:MouseEvent):void
{
// Actions performed in response to the event go here.
}
myButton.addEventListener(MouseEvent.CLICK, eventResponse);
Flash Player
1. SWF Flash Player eventResponse()

2. Flash Player
myButton addEventListener() eventResponse

-3-

1.

myButton addEventListener()
myButton eventResponse()

3. myButton click
MouseEvent.CLICK

1.
Flash Player MouseEvent
Event MouseEvent
""

2.

Flash Player myButton


eventResponse() myButton
Flash Player eventResponse()
-4-

3.

eventResponse()

ActionScript

""
ActionScript Flash
""Flash
Adobe Flex Builder Adobe Macromedia
MXML MXML
ID MXML Flex ID ActionScript

ActionScript
ActionScript "" ActionScript
ActionScript Number int uint String Boolean ArrayRegExpXML Object Function

new new
""""

new
ActionScript Flash

Flex Builder MXML new ActionScript

Flash new


-5-

""ActionScript

(/*) (*/)

ActionScript

if if
true

ActionScript
ActionScript 3.0

Flash
Flash ActionScript

1 Flash Flash
ActionScript Flash FLA
Flash ActionScript ActionScript
.as
ActionScript
ActionScript

ActionScript ActionScript
MXML
ActionScript include Adobe Flex MXML <mx:Script>
ActionScriptActionScript include
ActionScript Flex
MXML <mx:Script>
ActionScript

ActionScript ActionScript
ActionScript
ActionScript
import ActionScript

Flash flash.*
Flash fl.* Flex


ActionScript

Flash
-6-

Adobe Flash CS3 Professional ActionScript FLA


ActionScript Flash

ActionScript
Flash ActionScript SWF
Flash
A
d
o
b
eF
l
a
s
hC
S
3P
r
o
f
e
s
s
i
o
n
a
l Acti
onScript
"
F
L
A ActionSc
ript
"

"
"
"
"
Actio
nScr
ipt(.as)
Flex Builder
Adobe Flex Builder Flex MXML Flex
Builder ActionScript Flex ActionScript Flex

Flex
SWF Flash
Flex Internet
ActionScript MXML Flex Builder
ActionScript
ActionScript (.as)
ActionScript MXML ActionScript Flex
SDK Flex Flex SWF Flex ActionScript

ActionScript ActionScript
Flash
ActionS
crip
t
c
tionScri
pt Flash
A
A
c
t
i
on
Script HTML
Acti
onScrip
t
l
e
xS
D
K Flash FlexB
uild
er Act
ionScrip
t
F
F
l
e
x
ActionScript Adobe Dreamweaver CS3
ASDT FDT FlashDevelop PrimalScript SE|PY Xcode ActionScript

ActionScript
A
c
t
i
o
n
S
c
r
i
p
t3
.
0
1
.

2
. A
c
t
i
o
n
S
c
r
i
p
t3
.
0
F
l
a
s
h
F
l
e
xB
u
i
l
derDre
amweave
r Ac
tionScri
pt
3
. F
l
a
s
h F
l
e
x
F
l
a
s
h FLA
A
c
t
i
o
n
S
c
r
i
p
t Flex
M
X
M
L Act
ionScript
4
. A
c
t
i
o
n
S
c
r
i
pt
F
l
a
s
h F
lex

-7-

1
.


2
.
3
.
4
.


""

5
.

A
c
t
i
o
n
S
c
r
i
p
t
1
. A
c
t
i
o
n
S
c
r
i
p
t Fl
exBuil
der Flash Dreamw
eaver

2
. c
l
a
s
s pu
blicclass

public

3
. p
a
c
k
a
g
e pack
age
c
l
a
s
s
4
. v
a
r publi
c

5
.

"
"


A
c
t
i
o
n
S
c
r
i
p
t EventDis
patcher

A
d
o
b
e
-8-

ActionScript
ActionScript 3.0 ActionScript Adobe Flash Player (API)
ActionScript ActionScript ECMAScript (ECMA-262) 4 Flash
Player API Flash Player

A
c
t
i
o
n
S
c
r
i
p
t3
.
0 Ac
tionScript3
.0
Actio
nScript3.0

E
C
M
A
S
c
r
i
p
t 4A
c
t
i
o
n
S
c
ript3.0

J
a
v
a C
+
+ EC
MAScript
A
c
t
i
o
n
S
c
r
i
p
t3
.
0 J
a
va C++ Acti
onScript
""
"
"

A
c
t
i
o
n
S
c
r
i
p
t J
a
v
a C
+
+ Action
Script
A
c
t
i
o
n
S
c
r
i
p
t Java C
++

A
c
t
i
o
n
S
c
r
i
p
t J
a
v
a C
+
+ Action
Script""
A
c
t
i
o
n
S
c
r
i
p
t"
"
A
c
t
i
o
n
S
c
r
i
p
t3
.
0

A
c
t
i
o
n
S
c
r
i
p
t3
.
0

"
"

A
c
t
i
o
n
S
c
r
i
p
t Number
Boolea
n St
ring

A
c
t
i
o
n
S
c
r
i
p
t A
rrayMath XML ECMAScr
ipt

Object Acti
onScrip
t
O
b
j
e
c
t Ac
tionS
cript
2
.
0 Object
v
a
rs
o
m
e
O
b
j
:
O
b
j
e
c
t
;
v
a
rs
o
m
e
O
b
j
;
A
c
t
i
o
n
S
c
r
i
p
t3
.
0
v
a
rs
o
m
e
O
b
j
:
*
;
v
a
rs
o
m
e
O
b
j
;
O
b
j
e
c
t un
defined

O
b
j
e
c
t
c
l
a
s
s (proper
ty)

c
o
n
s
t v
a
r get set (attri
bute) gett
er
s
e
t
t
e
r (
p
r
o
p
e
r
t
y
)
f
u
n
c
t
i
on
n
e
w

-9-


ActionScript 3.0

(.
)
J
a
v
aA
ctionSc
ript
3
.
0

p
u
b
l
i
c i
n
t
e
r
n
a
l
J
a
v
a ActionSc
ript3.0

A
c
t
i
o
n
S
c
r
i
p
t3
.
0

A
c
t
i
o
n
S
c
r
i
p
t3
.
0 Action
Script3
.0
p
a
c
k
a
g
e
public intern
al
p
u
b
l
ic

i
m
p
o
r
t


"
"""

int
ernal
pu
blic
p
u
b
l
i
c

A
c
t
i
o
n
S
c
r
i
p
t3
.
0 i
n
c
l
u
d
e ActionSc
ript3.0
i
m
p
o
r
t

publi
cpriva
teprote
cted internal

- 10 -

internal
i
nternal

p
u
b
l
i
c

n
a
m
e
s
p
a
c
e vers
ion1
n
a
m
e
s
p
a
c
ev
e
r
s
i
o
n
1
;

m
y
F
u
n
c
t
i
o
n
(
) v
e
r
s
i
o
n
1
v
e
r
s
i
o
n
1f
u
n
c
t
i
o
nm
y
F
u
n
c
t
i
o
n
(
){
}
use
u
s
e m
y
F
u
n
c
t
ion()
u
s
en
a
m
e
s
p
a
c
ev
e
r
s
i
o
n
1
;
m
y
F
u
n
c
t
i
o
n
(
)
;
m
y
F
u
n
c
ti
on()
v
e
r
s
i
o
n
1
:
:
m
y
F
u
n
c
t
i
o
n
(
)
;

(URI) URI
(Uniform Resource Identifier, URI)
URI (URN) (URL)
XML
URI URI
URI
namespace flash_proxy = "http://www.adobe.com/flash/proxy";
URI URI
URI
namespace flash_proxy;
URI URI

flash.utils flash_proxy
flash_proxy flash.utils

package flash.utils
{
namespace flash_proxy;
}
public flash_proxy
package flash.utils
{
public namespace flash_proxy;
}

p
u
b
l
i
c public
p
u
b
l
i
c
p
u
b
l
i
c
- 11 -

e
x
a
m
p
l
e
1 myFuncti
on() exa
mple1

n
a
m
e
s
p
a
c
ee
x
a
m
p
l
e
1
;
c
l
a
s
ss
o
m
e
C
l
a
s
s
{
e
x
a
m
p
l
e
1m
y
F
u
n
c
t
i
o
n
(
){
}
}
m
y
F
u
n
c
t
i
o
n
(
) ex
ample1 exam
ple1


1
0
10

publ
icpriv
atepro
tected inter
nal

publi
cp
rivatepro
tected intern
al
pri
vate

u
s
en
a
m
e
s
p
a
c
e (:
:)
u
s
en
a
m
e
s
p
a
c
e
e
x
a
m
p
l
e
1 u
senamespac
eexampl
e1
u
s
en
a
m
e
s
p
a
c
ee
x
a
m
p
l
e
1
;
m
y
F
u
n
c
t
i
o
n
(
)
;
us
enames
pace

usenamespac
e
e
x
a
m
p
l
e
1 m
y
F
u
n
c
t
i
o
n
()
e
x
a
m
p
l
e
1
:
:
m
y
F
u
n
c
t
i
o
n
(
)
;

Flash Player API flash.utils.Proxy Proxy


ActionScript 2.0 Object.__resolve
Proxy flash_proxy
flash_proxy Proxy Proxy
Proxy Proxy
Proxy Proxy callProperty()

Proxy flash_proxy Flash Player API


flash_proxy Proxy flash_proxy Proxy

flash_proxy flash.utils
package flash.utils
{
public namespace flash_proxy;
}
- 12 -

Proxy Proxy
public class Proxy
{
flash_proxy function callProperty(name:*, ... rest):*
flash_proxy function deleteProperty(name:*):Boolean
...
}
Proxy flash_proxy
Proxy dynamic callProperty()
flash_proxy
package
{
import flash.utils.Proxy;
import flash.utils.flash_proxy;
dynamic class MyProxy extends Proxy
{
flash_proxy override function callProperty(name:*, ...rest):*
{
trace("method call intercepted: " + name);
}
}
}
MyProxy testing()
Proxy callProperty()
trace()
var mySample:MyProxy = new MyProxy();
mySample.testing(); //
Proxy flash_proxy Proxy
Proxy 12
Proxy
Proxy flash_proxy
callProperty() callProperty()

dynamic class MyProxy extends Proxy


{
public function callProperty() {}
flash_proxy override function callProperty(name:*, ...rest):*
{
trace("method call intercepted: " + name);
}
}
publicprivateinternal protected

use namespace
- 13 -

(myInternal.as)
myInternal example example
public
// example myInternal.as
package example
{
public namespace myInternal = "http://www.adobe.com/2006/actionscript/examples";
}
(Utility.as) (Helper.as) Utility
example.alpha example alpha Helper
example.beta example beta example.alpha
example.beta
// example/alpha Utility.as
package example.alpha
{
import example.myInternal;
public class Utility
{
private static var _taskCounter:int = 0;
public static function someTask()
{
_taskCounter++;
}
myInternal static function get taskCounter():int
{
return _taskCounter;
}
}
}
// example/beta Helper.as
package example.beta
{
import example.myInternal;
public class Helper
{
private static var _timeStamp:Date;
public static function someTask()
{
_timeStamp = new Date();
}
myInternal static function get lastCalled():Date
- 14 -

{
return _timeStamp;
}
}
}
(NamespaceUseCase.as) example Adobe Flash CS3
Professional FLA NamespaceUseCase myInternal
myInternal

// NamespaceUseCase.as
package
{
import flash.display.MovieClip;
import example.myInternal;
//
import example.alpha.Utility;
// Utility
import example.beta.Helper;
// Helper
public class NamespaceUseCase extends MovieClip
{
public function NamespaceUseCase()
{
use namespace myInternal;
Utility.someTask();
Utility.someTask();
trace(Utility.taskCounter); // 2
Helper.someTask();
trace(Helper.lastCalled);

// [ someTask() ]

}
}
}

var A
ctionSc
ript3.
0
v
a
r
v
a
r

(:)

(
=
)

(
,)

"
"
""

"
"
Acti
onScript3.0

- 15 -

"
"
"
"
"
"
Act
ionScrip
t3.0

(
{
) (
}) ActionS
cript

"
"

"
"
"
"

"
"

B
o
o
l
e
a
n

false

i
n
t

N
u
m
b
e
r

NaN

O
b
j
e
c
t

null

S
t
r
i
n
g

null

u
i
n
t

undefine
d

null

N
u
m
b
e
r Na
NNaN IEEE-7
54

*
undefine
d
B
o
o
l
e
a
n
N
u
m
b
e
r
i
n
t u
i
n
t nu
ll
F
l
a
s
hP
l
a
y
e
rA
P
I
B
o
o
l
e
a
n
N
u
m
b
e
r
i
n
t u
i
n
tnull nul
l
O
bject null
u
n
d
e
f
i
n
e
d O
b
j
e
c
t null
N
u
m
b
e
r isNaN()
t
r
u
e
f
a
l
s
e

"
"
A
c
t
i
o
n
S
cript3.0
"
"
Bool
ea
nint
Number
Stri
ng ui
nt
A
c
t
i
o
n
Scrip
t

A
c
t
i
o
n
S
c
r
i
p
t

"
"
A
rray
Date
Erro
rF
unction
Reg
Exp

X
M
L X
M
L
L
i
s
t

- 16 -

A
c
t
i
o
n
S
c
r
i
p
t3
.
0
F
l
a
s
hP
l
a
y
e
r

ActionScri
pt3.0
A
c
t
i
o
n
S
c
r
i
p
t3
.
0 new

A
c
t
i
o
n
S
c
r
i
p
t3
.
0""

Ado
beFlashCS3Profess
ional AdobeF
lexBuil
der2
A
c
t
i
o
n
S
c
r
i
p
t

(:)

A
c
t
i
o
n
S
c
r
i
p
t

(
*
)

A
c
t
i
o
n
S
c
r
i
p
t3
.
0

"
"

is

is ActionScript 3.0
is

a
s
a
s A
c
t
i
o
n
S
c
r
i
p
t3
.
0
i
sa
s true
nul
l
fals
e
a
s

""/ String
""
dynamic

this
- 17 -


BooleanintNullNumberStringuint voidActionScript
ObjectArrayDateErrorFunctionRegExpXML XMLList
Boolean
Boolean true false Boolean
false
int
int 32 -2,147,483,648 (-231) 2,147,483,647 (231 - 1)
-2,147,483,648 2,147,483,647 ActionScript Number
ActionScript 3.0 32
int Number

int int Number Number


-9,007,199,254,740,992 9,007,199,254,740,99253 int
0
Null
Null null String Object
BooleanNumberint uint null Boolean
Numberint uint null Flash Player null Null

Number
ActionScript 3.0 Number
Number int uint 32

Number IEEE (IEEE-754) 64


64 1 11
52 """" 2 N N

Number Number

Number Number Number.MAX_VALUE


Number.MIN_VALUE
Number.MAX_VALUE == 1.79769313486231e+308
Number.MIN_VALUE == 4.940656458412467e-324
Number 52
52 1/3

Number 52 Number 52
-9,007,199,254,740,992 (-253) 9,007,199,254,740,992 (253)
Flash Player NaN Number
Number """"
0 0 NaN 0

String
String 16 Unicode UTF-16
Java
String null null ("")

- 18 -

uint
uint 32 0 4,294,967,295 (232- 1)
0 4,294,967,295uint uint
int uint
Number 53 uint 0
void
void undefined ActionScript 3.0 Object null
undefined Object Flash Player null
undefined (*) void

Object
Object Object Object ActionScript ActionScript
3.0 Object Object Object
Object undefined
Object ActionScript 3.0 Object null
ActionScript Object ActionScript 3.0
Object
(*)

undefined undefined Flash Player


undefined Object null
undefined Object Flash Player undefined null

""
"
"
"
"
F
l
a
shPl
ayer""

i
n
t
u
i
n
t N
u
m
b
e
r
intuint Numb
er FlashP
layer
i
n
t u
int 0 Number NaN
t
r
u
e 1fals
e 0

0
x
1
A

N
u
m
b
e
r
(
) uin
t() i
nt()

int() ui
nt() 0 Number(
)
N
a
N
0
N
a
N

A
c
t
i
o
n
S
c
r
i
p
t3
.
0N
u
m
b
e
r
(
) 8 ActionS
cript3.
0
N
u
m
b
e
r
(
) 0

- 19 -

v
a
rm
y
U
I
n
t
:
u
i
n
t=3
;/
/ i
n
t
/
N
um
ber uint
t
r
a
c
e
(
m
y
U
I
n
t
)
;/
/4
2
9
4
9
6
7
2
9
3
v
a
rm
y
N
u
m
:
N
u
m
b
e
r=s
a
m
p
l
e
U
I
N
T
;/
/ int/u
int Numb
er
t
r
a
c
e
(
m
y
N
u
m
)/
/4
2
9
4
9
6
7
2
9
3
v
a
rm
y
I
n
t
:
i
n
t=u
i
n
t
.
M
A
X
_
V
A
L
U
E+1;// Numb
er u
int
t
r
a
c
e
(
m
y
I
n
t
)
;/
/0
m
y
I
n
t=i
n
t
.
M
A
X
_
V
A
L
U
E+1
;/
/ ui
nt/Numb
er int
t
r
a
c
e
(
m
y
I
n
t
)
;/
/2
1
4
7
4
8
3
6
4
8
N
u
mb
erint uint

Numberint uint

B
o
o
l
e
a
n
D
a
t
e

t
r
u
e
1 0

D
a
t
e 1970 1 1

n
u
l
l

O
b
j
e
c
t

n
u
l
l Nu
mber NaN
0

S
t
r
i
n
g

F
l
a
s
hP
l
a
y
e
r
N
u
m
b
e
r
N
a
N in
t ui
nt 0

u
n
d
e
f
i
n
e
d

N
u
m
b
e
r
NaN in
t uint 0

B
o
o
l
e
a
n

uintint Number Boolean 0


false true Number NaN false
Boolean null ("")
false true
Object Boolean null false
true

Boolean
Boolean

Boolean

Boolean
String
null ("") false true
null
false
Numberint uint NaN 0 false true
Object
null false true
String
S
t
r
i
n
g
S
t
r
i
n
g t
r
u
e
"true" f
alse "fal
se"

O
b
j
e
c
t S
t
r
i
n
g null
"null"

"
[
o
b
j
e
c
tO
b
j
e
c
t
]
"

A
r
r
a
y S
t
r
i
n
g
D
a
t
e S
t
r
i
n
g

- 20 -

St
ring

A
r
r
a
y
B
o
o
l
e
a
n

String

"
t
r
u
e
" "
false"

D
a
t
e

D
a
t
e

n
u
l
l

"
n
u
l
l
"

N
u
m
b
e
r
i
n
t u
i
n
t
O
b
j
e
c
t

null "
null" "
[obj
ectObject]
"

ActionScript 3.0

( . )

""
([ ])
new Array
ActionScript ObjectArrayStringNumberintuint
XMLXMLList Boolean
Object ({ })
( : )
new Object

( ; )

ActionScript 3.0 (())

(,)

ActionScript 3.0 C++ Java

(//)
(/*) (*/)

"" ActionScript
""

- 21 -

ActionScript 3.0
as

break

case

catch

class

const

continue

default

delete

do

else

extends

false

finally

for

function

if

implements

import

in

instanceof

interface

internal

is

native

new

null

package

private

protected

public

return

super

switch

this

throw

to

true

try

typeof

use

var

void

while

with
""
ActionScript 3.0
each

get

set

namespace

include

dynamic

final

native

override

static

"" ActionScript 3.0


ActionScript 3.0
Adobe ActionScript
abstract

boolean

byte

cast

char

debugger

double

enum

export

float

goto

intrinsic

long

prototype

short

synchronized

throws

to

transient

type

virtual

volatile

ActionScript 3.0 const

Flash Player API ActionScript


( _)

""

"" 1 "" 2 ""


3
""
(+)

(-)

- 22 -

(*) (+)
""ActionScript (())

""""
(?:) ""

ActionScript 3.0

[] {x:y} () f(x) new x.y x[y] <></> @ :: ..

x++ x--

++x --x + - ~ ! delete typeof void

*/%

+-

<< >> >>>

< > <= >= as in instanceof is

== != === !==

""

&

""

""

""

&&

""

||

?:

= *= /= %= += -= <<= >>= >>>= &= ^= |=

Array Object

E4X (E4X)

[]

{x:y}

()

f(x)

new

x.y x[y]

<></>

XMLList (E4X)

(E4X)
- 23 -

::

(E4X)

..

XML (E4X)

++

--

(++) (--) ""

++

--

""

""

delete

typeof

void

undefined

<<

>>

>>>

- 24 -

<

>

<=

>=

as

in

instanceof

is

==

!=

===

!==

&

""

""

""

&&

""

||

""

if..else

?:

- 25 -

*=

/=

%=

+=

-=

<<=

>>=

>>>=

&=

""

^=

""

|=

""

ActionScript 3.0 if..else

if..else if

switch

if..else
if..else
if else
if..else if
if..else if
switch
switch if..else
if switch
case break

for for..in for each..in while do..while


for
for for 3

for..in
for..in

for each..in
for each..in XML XMLList
for each..in for..in for
each..in

while
while if true
while for while
for while
i
do..while
- 26 -

do..while while

""ActionScript 3.0 """"

(())

ActionScript 3.0

function

ActionScript

ActionScript
var

(:)
Function
(=)
function

ActionScript

var function

([ ]) ( . )

- 27 -

return
return return

A
c
t
i
o
n
S
c
r
i
p
t3
.
0
B
o
o
l
e
a
n
N
u
m
b
e
r
i
n
t
u
i
n
t Str
ing

p
assPr
imit
ives() int

x
P
a
r
a
m y
P
a
r
a
m pas
sPrimitives
()
x
V
a
l
u
e y
V
a
l
u
ex
P
a
r
am yPa
ram inti
nt
x
V
a
l
u
e y
V
a
l
u
e xParam yPa
ram
x
V
a
l
u
e y
V
a
l
u
e

f
u
n
c
t
i
o
np
a
s
s
P
r
i
m
i
t
i
v
e
s
(
x
P
a
r
a
m
:
i
n
t,yParam
:int
):void
{
x
P
a
r
a
m
+
+
;
y
P
a
r
a
m
+
+
;
t
r
a
c
e
(
x
P
a
r
a
m
,y
P
a
r
a
m
)
;
}
v
a
rx
V
a
l
u
e
:
i
n
t=1
0
;
v
a
ry
V
a
l
u
e
:
i
n
t=1
5
;
t
r
a
c
e
(
x
V
a
l
u
e
,y
V
a
l
u
e
)
;
/
/1015
p
a
s
s
P
r
i
m
i
t
i
v
e
s
(
x
V
a
l
u
e
,y
V
a
l
u
e
)
;/
/1116
t
r
a
c
e
(
x
V
a
l
u
e
,y
V
a
l
u
e
)
;
/
/1015
p
a
s
s
P
r
i
m
i
t
i
v
e
s
(
)x
P
a
ra
m yP
aram xVa
lue y
Value
t
r
a
c
e xVal
ue yValu
e
x
V
a
l
u
e y
V
a
l
u
e

o
b
j
V
a
rx y pas
sBy
Ref()
- 28 -

f
u
n
c
t
i
o
np
a
s
s
B
y
R
e
f
(
o
b
j
P
a
r
a
m
:
O
b
j
e
c
t)
:void
{
o
b
j
P
a
r
a
m
.
x
+
+
;
o
b
j
P
a
r
a
m
.
y
+
+
;
t
r
a
c
e
(
o
b
j
P
a
r
a
m
.
x
,o
b
j
P
a
r
a
m
.
y
)
;
}
v
a
ro
b
j
V
a
r
:
O
b
j
e
c
t={
x
:
1
0
,y
:
1
5
}
;
t
r
a
c
e
(
o
b
j
V
a
r
.
x
,o
b
j
V
a
r
.
y
)
;/
/1
015
p
a
s
s
B
y
R
e
f
(
o
b
j
V
a
r
)
;
/
/1
116
t
r
a
c
e
(
o
b
j
V
a
r
.
x
,o
b
j
V
a
r
.
y
)
;/
/1
116
o
b
j
P
a
r
a
m o
b
j
V
a
r tr
ace
o
b
j
P
a
r
a
m x y objVar

A
c
t
i
o
n
S
c
r
i
p
t3
.
0""

"
"
"
"

a
r
g
u
m
e
n
t
s
a
rgument
sargum
ents

r
g
u
m
e
n
t
s
a
r
g
u
m
e
n
t
s
.
l
e
n
g
t
h
a
a
r
g
u
m
e
n
t
s
.
c
a
l
l
e
e
a
r
g
u
m
e
n
t
s
.
..(r
est) argum
ents
A
c
t
i
o
n
S
c
r
i
p
t3
.
0
argume
nts

a
r
g
u
m
e
n
t
s
.
c
a
l
l
e
e
argument
s.callee

.
.
.
(
r
e
s
t
) argument
s
"
a
r
g
u
m
e
n
t
s
" argume
nts
...(rest)
A
c
t
i
o
n
S
c
r
i
p
t3
.
0 .
..(rest)

a
r
g
u
m
e
n
t
s ...(rest) argu
ments
a
r
g
u
m
e
n
t
s
.
l
e
n
g
t
h arguments.
callee .
..(rest
)
a
r
g
u
m
e
n
t
s
.
c
a
l
l
e
e

...(rest) ...(rest)

A
c
t
i
o
n
S
c
r
i
p
t3
.
0

A
c
t
i
o
n
S
c
r
i
p
t
- 29 -

le
ngth
a
r
g
u
m
e
n
t
s
.
l
e
n
g
t
h ActionS
cript

"
"

"
"
F
lashPl
ayer

Action
Script

"
"
""

f
o
o
()
rectArea
() bar(
)
f
o
o
(
) myPr
oduct bar(
)
x
2
m
y
P
r
o
d
u
c
t
() foo() x
40
b
a
r
(
) 1
6
0
8
f
u
n
c
t
i
o
nf
o
o
(
)
:
F
u
n
c
t
i
o
n
{
v
a
rx
:
i
n
t=4
0
;
f
u
n
c
t
i
o
nr
e
c
t
A
r
e
a
(
y
:
i
n
t
)
:
i
n
t//
{
r
e
t
u
r
nx*y
}
r
e
t
u
r
nr
e
c
t
A
r
e
a
;
}
f
u
n
c
t
i
o
nb
a
r
(
)
:
v
o
i
d
{
v
a
rx
:
i
n
t=2
;
v
a
ry
:
i
n
t=4
;
v
a
rm
y
P
r
o
d
u
c
t
:
F
u
n
c
t
i
o
n=f
o
o
(
);
t
r
a
c
e
(
m
y
P
r
o
d
u
c
t
(
4
)
)
;/
/
}
b
a
r
(
)
;/
/1
6
0

this
thi
s

- 30 -

ActionScript

(OOP)

""
OOP
OOP

get set




(Attribute)

rivate public
p

(Class)
(Class hierarchy)
(Constructor)

(Data type)""""
) ActionScript
(Dot operator) (.

(Enumeration)
(Inheritance) OOP

(Instance)
(Namespace)

c
l
a
s
s ({
})
A
c
t
i
o
n
S
c
r
i
p
t3
.
0 p
a
ck
age

A
c
t
i
o
n
S
c
r
i
p
t3
.
0

d
y
n
a
m
i
c

f
i
n
a
l

i
n
t
e
r
n
a
l

- 31 -

i
n
t
e
r
n
a
l
d
y
n
a
m
i
c (
a
t
t
r
i
b
u
t
e
)
(prope
rty)

a
b
s
t
r
a
c
t Action
Script3
.0
p
r
i
v
a
t
e p
r
o
t
e
c
t
e
d
inter
nal
i
n
t
e
r
n
a
l p
u
b
l
i
c inte
rnal

A
c
t
i
o
n
S
c
r
i
p
t3
.
0

A
c
t
i
o
n
S
c
r
i
p
t3
.
0
(
p
r
o
p
e
r
t
y
) (
a
t
t
r
i
b
u
t
e
)
A
c
t
i
o
n
S
c
r
i
p
t""
ActionScript3.0
g
e
t
t
e
r s
e
t
t
e
r Act
ionScrip
t3.0
(
p
r
o
p
e
r
t
y
) (attr
ibut
e)

i
n
t
e
r
n
a
l

p
r
i
v
a
t
e

p
r
o
t
e
c
t
e
d

p
u
b
l
i
c

s
t
a
t
i
c

UserDefinedNamespace

A
c
t
i
o
n
S
c
r
i
p
t3
.
0 (att
ribu
te) (prope
rty)
p
u
b
l
i
c
p
r
i
v
a
t
e
p
r
o
t
e
c
t
e
d i
n
t
e
r
n
a
l
p
u
b
l
i
c (
a
t
t
r
i
b
u
t
e
) (pro
perty)
p
u
b
l
i
c var
con
st
f
u
n
c
t
i
o
n
p
r
i
v
a
t
e (
a
t
t
r
i
b
u
t
e
) (pr
operty) (p
roperty)

A
c
t
i
o
n
S
c
r
i
p
t3
.
0

p
riva
te

(
.
)

([]
)

d
y
n
a
m
i
c F
la
sh
P
l
a
y
e
r u
n
d
e
f
i
n
e
d

p
r
i
v
a
t
e undefi
ned
pri
vate

(
.
)

undefined

([]
)

undefined

undefined

- 32 -

p
r
o
t
e
c
t
e
d (
a
t
t
r
i
b
u
t
e
) A
c
t
io
nScript3.0 (attr
ibute) (prope
rty)
prot
ect
ed

i
n
t
e
r
n
a
l (
a
t
t
r
i
b
u
t
e
) A
c
t
i
on
Script3
.0 (attribu
te) (pr
operty)
(attribute) (attri
but
e)
(
p
r
o
p
e
r
t
y
)

p
u
b
l
i
c
r
i
v
a
t
e
p
r
o
t
e
c
t
e
d
p

static
s
t
a
t
i
c (
a
t
t
r
i
b
u
t
e
) va
rconst function (prop
erty)
(
a
t
t
r
i
b
u
t
e
) (
p
rop
erty)
(
p
r
o
p
e
r
t
y)

publicpriv
ateprotect
ed i
nternal

ar const var
v
onst""
c

tatic var const


s

s
tatic const

v
a
r c
o
n
s
t s
tatic
A
rray l
ength Array

v
a
r c
o
n
s
t gette
r set
ter

function

o
v
e
r
r
i
d
e final

co
nst var

o
v
e
r
r
i
d
e f
i
n
a
l

- 33 -


"
"
n
ew

public
p
r
i
v
a
t
e
p
r
o
t
e
c
t
e
d int
erna
l
s
u
p
e
r
(
)
su
per
super
() super super()
sup
er
s
u
p
e
r
(
) t
hrow ret
urn
r
e
t
u
r
nret
urn

s
u
per()

"
"
static

th
is su
perthis sup
er

A
c
t
i
o
nS
cript3
.0

s
t
a
t
i
c

ActionScript 3.0
t
h
i
s
o
v
e
r
r
i
d
e f
i
n
a
l over
ride
f
i
n
a
l
get set
g
e
t s
e
t g
etter setter
g
et set

ge
tPropert
yName()
s
e
t
P
r
o
p
e
r
t
y
N
a
m
e
(
)
g
e
t
t
e
r s
e
t
t
e
r

g
e
t
t
e
r s
e
t
t
e
r
v
a
r getter sett
er
g
e
t
t
e
r s
e
t
t
er override

"
"

A
c
t
i
o
n
S
c
r
i
pt3.
0
this
this
t
h
i
s
t
h
i
s this
A
c
t
i
o
n
S
c
r
i
p
t t
h
i
s
- 34 -

Act
ionS
criptt
his
A
c
t
i
o
n
S
c
r
i
p
t2
.
0 this
A
c
t
i
o
n
S
c
r
i
p
t3
.
0
t
h
i
s
T
h
i
s
T
e
s
t foo(
)
b
a
r
(
) ThisTe
st b
ar()
m
y
F
u
n
c
c
l
a
s
sT
h
i
s
T
e
s
t
{
p
r
i
v
a
t
ev
a
rn
u
m
:
N
u
m
b
e
r=3
;
f
u
n
c
t
i
o
nf
o
o
(
)
:
v
o
i
d/
/
{
t
r
a
c
e
(
"
f
o
o
'
st
h
i
s
:"+t
h
is
);
t
r
a
c
e
(
"
n
u
m
:"+n
u
m
)
;
}
f
u
n
c
t
i
o
nb
a
r
(
)
:
F
u
n
c
t
i
o
n
{
r
e
t
u
r
nf
o
o
;/
/
}
}
v
a
rm
y
T
e
s
t
:
T
h
i
s
T
e
s
t=n
e
wT
h
i
s
T
e
s
t(
);
v
a
rm
y
F
u
n
c
:
F
u
n
c
t
i
o
n=m
y
T
e
s
t
.
b
a
r
(
);
t
r
a
c
e
(
t
h
i
s
)
;/
/[
]
m
y
F
u
n
c
(
)
;
/
*
f
o
o
'
st
h
i
s
:[
o
b
j
e
c
tT
h
i
s
T
e
s
t
]
o
u
t
p
u
t
:n
u
m
:3*
/
this foo(
) t
his
T
h
i
s
T
e
s
t m
yFunc ThisTest
A
c
t
i
o
n
S
c
r
i
p
t2
.
0this num u
ndefined

addEve
ntListen
er()

"ActionScript 3.0
fin
al

Flash Player API Stringint uint


ActionScript

Flash Player API

A
c
t
i
o
n
S
c
r
i
p
t3
.
0"
""
" S
WF

S
W
F
- 35 -

Flash
FLA

is as

g
e
t
t
e
r s
e
t
t
e
r
interf
ace
p
u
b
l
i
c i
n
t
e
r
n
a
l

Flash Player API I

ActionScript 3.0 implements

p
u
b
l
i
c

"
""
"

"
"

ex
tends
"
"

""

(
p
r
o
p
e
r
t
y
)
functi
onvar const
p
r
i
v
a
t
e (
a
t
t
r
i
b
u
t
e
) (
prop
erty)

- 36 -

p
u
b
l
i
c public
p
r
i
v
a
t
e
p
r
o
t
e
c
t
e
d i
n
t
e
r
n
a
l
p
r
i
v
a
t
e

p
r
o
t
e
c
t
e
dActionScript 3.0
p
r
o
t
e
c
t
e
dprotected

internal
intern
al intern
al

v
a
r c
o
n
s
t
fu
nction
g
e
t
t
e
r s
e
t
t
e
r

f
i
n
a
l final

r
i
v
a
t
e priva
te
p
overrid
e
ov
erride

s
u
p
e
r

super

g
e
t
t
e
r s
e
t
t
e
r
get
ter sett
er

"
"

"
"

- 37 -


A
c
t
i
o
n
S
c
r
i
p
t OOP ActionSc
ript3.0
A
c
t
i
o
n
S
c
r
i
p
t (
A
V
M
2) ActionSc
ript (AVM
1)
F
l
a
s
hP
l
a
y
e
r
ActionScript OOP
A
c
t
i
o
n
S
c
r
i
p
t3
.
0 Action
Scri
pt ActionS
cript
A
c
t
i
o
n
S
c
r
i
p
t Flash
A
c
t
i
o
n
S
c
r
i
p
t

ActionScript 1.0
A
c
t
i
o
n
S
c
r
i
p
t1
.
0 F
l
a
s
hP
l
a
y
e
r6
A
c
t
i
o
n
S
c
r
i
p
tAct
ionScrip
t"
"
"
"

A
c
t
i
o
n
S
c
r
i
p
t class
J
a
v
a C
+
+ cla
ss
A
c
t
i
o
n
S
c
r
i
p
t1
.
0

A
c
t
i
o
n
S
c
r
i
p
t1
.
0 ActionSc
ript
Shape
v
i
s
i
b
l
e tr
ue
/
/
f
u
n
c
t
i
o
nS
h
a
p
e
(
){
}
/
/ v
i
s
i
b
l
e
S
h
a
p
e
.
p
r
o
t
o
t
y
p
e
.
v
i
s
i
b
l
e=t
r
u
e
;
n
e
w Sh
ape
m
y
S
h
a
p
e=n
e
wS
h
a
p
e
(
)
;
S
h
a
p
e
(
) S
h
a
pe Shape Shap
e

S
h
a
p
e
/
/
f
u
n
c
t
i
o
nC
i
r
c
l
e
(
i
d
,r
a
d
i
u
s
)
{
t
h
i
s
.
i
d=i
d
;
t
h
i
s
.
r
a
d
i
u
s=r
a
d
i
u
s
;
}
n
e
w S
h
a
p
e Circle Ob
ject
C
i
r
c
l
e
.
p
r
o
t
o
t
y
p
eObjec
t Ci
rcle
S
h
a
p
e O
b
j
e
c
t
C
ircle.proto
type Shap
e

/
/ C
i
r
c
l
e S
h
a
p
e
C
i
r
c
l
e
.
p
r
o
t
o
t
y
p
e=n
e
wS
h
a
p
e
(
)
;
S
h
a
p
e C
i
r
c
l
e""

- 38 -

O
b
j
e
c
tO
bject Object.p
rototype
A
c
t
i
o
n
S
c
r
i
p
t1
.
0 Shape
S
h
a
p
e
.
p
r
o
t
o
t
y
p
eObjec
t
C
i
r
c
l
e S
h
apeC
ircle.proto
type Sh
ape
C
i
r
c
l
e Circ
le
/
/ C
i
r
c
l
e
m
y
C
i
r
c
l
e=n
e
wC
i
r
c
l
e
(
)
;
v
i
s
i
b
l
e Shapev
isible
m
y
C
i
r
c
l
e S
h
a
p
e tr
ue
t
r
a
c
e
(
m
y
C
i
r
c
l
e
.
v
i
s
i
b
l
e
)
;/
/t
rue
F
l
a
s
hP
l
a
y
e
r m
y
C
ircle vi
sibleF
lashPla
yer
m
y
C
i
r
c
l
e visib
leFlashP
layer
C
i
r
c
l
e
.
p
r
o
t
o
t
y
p
e visibleFla
shPlayer
S
h
a
p
e
.
p
r
o
t
o
t
y
p
e visi
ble
ActionS
crip
t
3
.
0
ActionScript 2.0
A
c
t
i
o
n
S
c
r
i
p
t2
.
0 c
l
a
s
s
exten
dspu
blic pri
vate
J
a
v
a C
+
+Act
ionScrip
t1.0 Action
Scri
pt2.0
ActionScr
ipt2.0

A
c
t
i
o
n
S
c
r
i
p
t2
.
0
/
/
c
l
a
s
sS
h
a
p
e
{
v
a
rv
i
s
i
b
l
e
:
B
o
o
l
e
a
n=t
r
u
e
;
}
A
c
t
i
o
n
S
c
r
i
p
t2
.
0
v
i
s
i
b
l
e exten
ds
e
x
t
e
n
d
s A
c
t
ionSc
ript1.0
/
/
c
l
a
s
sC
i
r
c
l
ee
x
t
e
n
d
sS
h
a
p
e
{
v
a
ri
d
:
N
u
m
b
e
r
;
v
a
rr
a
d
i
u
s
:
N
u
m
b
e
r
;
f
u
n
c
t
i
o
nC
i
r
c
l
e
(
i
d
,r
a
d
i
u
s
)
{
t
h
i
s
.
i
d=i
d
;
- 39 -

t
h
i
s
.
r
a
d
i
u
s=r
a
d
i
u
s
;
}
}
id radi
us
A
c
t
i
o
n
S
c
r
i
p
t2
.
0

ActionScript 3.0
Ja
va C
++
Act
ionScrip
t
ActionS
cript
A
c
t
i
o
n
Scrip
t
A
c
t
i
o
n
S
c
r
i
p
t3
.
0
A
c
t
i
o
n
S
c
r
i
p
t
classA{} A
A A
(CA)
t
r
a
i
t
s (T
A) tra
its
(
T
C
A
) C"" (PA)
c
o
n
s
t
r
u
c
t
o
r
traits
t
r
a
i
t
s A
c
t
i
o
n
S
c
r
i
p
t3
.
0
A
c
t
i
o
n
S
c
r
i
p
t FlashPla
yer Act
ionScri
pt3
.0
tr
aits
t
r
a
i
t
stra
its
A
V
M
2AVM2

t
r
a
i
t
s Action
Scri
pt
dynamic
t
r
a
i
t
s Act
ionScrip
t2
.0
1
0
0 A
c
t
i
o
n
S
cript3.0 20
t
r
a
i
t
s Action
Script

A
c
t
i
o
n
S
c
r
i
p
t proto
type A
ctionScr
ip
t

p
r
o
t
o
t
y
p
e Actio
nScript
p
r
o
t
o
t
y
p
e pro
totype prototy
pe

A
c
t
i
o
n
S
c
r
i
p
t A
ctionScr
ipt3.0
t
r
a
i
t
s
c
l
assexte
nds over
ride

p
r
o
t
o
t
y
p
e
dy
namic
O
b
j
e
c
tO
bject toStr
ing() valueO
f()
O
b
j
e
c
t

p
u
b
l
i
cd
y
n
a
m
i
cc
l
a
s
sO
b
j
e
c
t
- 40 -

{
p
r
o
t
o
t
y
p
e
.
t
o
S
t
r
i
n
g=f
u
n
c
t
i
o
n
()
{
/
/
}
;
p
r
o
t
o
t
y
p
e
.
v
a
l
u
e
O
f=f
u
n
c
t
i
o
n
(
)
{
/
/
}
;
}
Object
t
o
S
t
r
i
n
g
(
)
O
b
j
e
c
t
.
p
r
o
t
o
t
y
p
e
.
t
o
S
t
r
i
n
g=f
u
n
c
t
io
n()
{
/
/
}
;
ov
erride
O
b
j
e
c
t v
alue
Of()
v
a
l
u
e
O
f
(
) Foo O
bject Foo
v
a
l
u
e
O
f
(
) Object e
xten
ds

d
y
n
a
m
i
cc
l
a
s
sF
o
o
{
p
r
o
t
o
t
y
p
e
.
v
a
l
u
e
O
f=f
u
n
c
t
i
o
n
(
)
{
r
e
t
u
r
n"
I
n
s
t
a
n
c
eo
fF
o
o
"
;
}
;
}
F
o
o valu
eOf()
F
o
o
.
p
r
o
t
o
t
y
p
e
.
v
a
l
u
e
O
f=f
u
n
c
t
i
o
n
(
)
{
r
e
t
u
r
n"
I
n
s
t
a
n
c
eo
fF
o
o
"
;
}
;
v
a
l
u
e
O
f
(
) Foo
v
a
l
ueOf(
) Foo ove
rride
v
a
l
u
e
O
f
(
) F
o
o
c
l
a
s
sF
o
o
{
f
u
n
c
t
i
o
nv
a
l
u
e
O
f
(
)
:
S
t
r
i
n
g
{
r
e
t
u
r
n"
I
n
s
t
a
n
c
eo
fF
o
o
"
;
}
}
AS3

E
C
M
A
S
c
r
i
p
t 4
FlashPlayerA
PI
- 41 -

c
o
n
s
tvar function

A
c
t
i
o
n
S
c
r
i
p
t3
.
0
E
CMAScrip
t
A
S
3 F
l
a
s
hP
layerAPI
A
S
3 AS3
AS3
A
S
3

A
S
3 AS3
A
S
3 A
r
r
a
y
.
p
o
p
(
)
v
a
rn
u
m
s
:
A
r
r
a
y=n
e
wA
r
r
a
y
(
1
,2
,3)
;
n
u
m
s
.
A
S
3
:
:
p
o
p
(
)
;
t
r
a
c
e
(
n
u
m
s
)
;/
/1
,
2
u
s
en
a
m
e
s
p
a
c
e AS3 us
e
n
a
m
e
s
p
a
c
e p
o
p
(
) p
u
s
h
(
) AS3
u
s
en
a
m
e
s
p
a
c
eA
S
3
;
v
a
rn
u
m
s
:
A
r
r
a
y=n
e
wA
r
r
a
y
(
1
,2
,3)
;
n
u
m
s
.
p
o
p
(
)
;
n
u
m
s
.
p
u
s
h
(
5
)
;
t
r
a
c
e
(
n
u
m
s
)/
/1
,
2
,
5
A
c
t
i
o
n
S
c
r
i
p
t3
.
0 AS
3-as3
A
S
3e
ses ECMAScri
pt A
S3
a
s
3 t
r
u
e
-es f
alse

A
d
o
b
eF
l
e
xB
u
i
l
d
e
r2 AdobeFlashCS
3Pro
fession
al -a
s3=true
e
s=f
a
l
s
e

A
S3
A
S
3 AS
3 o
verride
A
S
3 AS3 overr
ide

- 42 -

AS3
,,

Sound SoundChannel SoundMixer


ID3Info SoundLoaderContext SoundTransform

AS3

Sound
completeprogressid3
Sound
Sound SoundLoaderContext bufferTime
Sound
Sound ID3Info Sound.id3 ID3Info
SoundChannel SoundChannel
SoundChannel SoundChannel=Sound.play()
SoundChannel stop
Sound SoundChannel SoundMixer

SoundChannel SoundTransform

vartransform:SoundTransform=channel.soundTransform;
transform.volume=volume;
channel.soundTransform=transform;
- 43 -

:
1 SoundTransform
2 SoundTransform volume
3 SoundTransform SoundChannel
SoundMixerl
EQ SoundMixer
SoundTransform flash mp3
mp3

.
.

- 44 -

You might also like