as 3学習ノート(一)概要
7493 ワード
, , flex, , as3。
JavaScript ,ActionScript3( as3) ECMAScript , JavaScript ,
。 , as1.0 。Adobe as3 , prototype
。ActionScript , ActionScript , ActionScript 3.0
。 traits 。 OO 。( JavaScript
), ,
.
as3 OO C++,Java 。 :
Programmers familiar with object-oriented programming (OOP) in Java or C++ may think of objects as modules
that contain two kinds of members: data stored in member variables or properties, and behavior accessible through
methods. The ECMAScript edition 4 draft, the standard upon which ActionScript 3.0 is based, defines objects in a
similar but slightly different way. In the ECMAScript draft, objects are simply collections of properties. These
properties are containers that can hold not only data, but also functions or other objects. If a function is attached to
an object in this way, it is called a method.
: Java C++ (OOP) : ,
。 ECMAScript 4 (ActionScript 3.0 ) 。
ECMAScript , 。( : script , javascript
, 1) , , 。 ( : )
, 。
1: , javascript :
var myObj = {
color:"red",
name:"Ferrairi",
selectCar:function(){alert("I wanna a " + this.color + this.name);} ,
owner:{name:"ckp",age:25}
}
JSON :myObj color,name,selectCar,owner。 selectCar , myObj
;ower , !
, , , javascript ? , ,
ActionScript , 。 , as3 OO !
《ActionScript 3.0 》 , “ ” , “ ” 。