ActionScript 3.0을 공부하기위한 가장 기본적으로, 항상 참고해야할 사이트 입니다.
ActionScript Technology Center
http://www.adobe.com/devnet/actionscript/

레퍼런스
http://help.adobe.com/en_US/AS3LCR/Flash_10.0/

페이지를 보시면 다음과 같이 레퍼런스와 Programming 가이드 문서가 있습니다.
한글 버전은 주요 Object들의 이름들까지 한글로 번역을 해놓아서 오히려 혼돈의 우려가 있더군요.
(예:Display Object - 표시객체)
따라서, 영문문서를 보는것이 좋습니다. 아래와 같이 문서들이 있습니다.



일단은 Flash 를 기준으로 스터디를 하기 위해 Flash용 문서를 받아 보시면 됩니다.
(ActionScript 에 대한 내용은 기본적으로 같습니다.)

해당 페이지로 들어가셔서 우측 상단을 보시면 PDF 로 다운로드 받을 수 있는 메뉴가 있습니다.
PDF 로 저장해놓고 수시로 볼 수 있는게 좋겠죠.


AS3.0 의 주요 특징
- ActionScript 3.0 goes beyond the scripting capabilities of previous versions of ActionScript. It is designed to facilitate the creation of highly complex applications with large data sets and object-oriented, reusable code bases.
- 새로운 버전의 ActionScript Virtual Machine2 (AVM2) 사용
- ActionScript 3.0 is architecturally and conceptually different from previous versions of ActionScript.
- A single SWF file cannot combine ActionScript 1.0 or 2.0 code with ActionScript 3.0 code.

AS2.0 과의 표면적인 차이점
완전한 프로그래밍 언어의 성격을 갖추면서 변수의 타입을 명확하게 명시를 해주어야 합니다.
기존처럼 타임라인 여기저기서 무비클립등에다가 임의로 이름만 써서 변수를 만들던 방식은 이제 통용불가!

다음과 같이 변수 선언시 var 를 붙이고, 변수이름 뒤에는 : 와 타입명을 명시해주어야 함.
var myNumber:Number = 17;
var myString:String = "Hello SADI";


class (클래스) 와 object (객체) 그리고 instance(인스턴스) 개념
AS3.0 이 Object Oriented Programming 을 지향하면서 이들의 개념도 알아야 제대로 다룰 수 있게 되었습니다.
이들은 Processing 이나 Java 에 등장하는 class 와 같습니다.

Two words that are often used as synonyms for data type are class and object. A class is simply the definition of a data type—it’s like a template for all objects of the data type, like saying “all variables of the Example data type have these characteristics: A, B, and C.” An object, on the other hand, is just an actual instance of a class; a variable whose data type is MovieClip could be described as a MovieClip object. The following are different ways of saying the same thing:

•The data type of the variable myVariable is Number.
•The variable myVariable is a Number instance.
•The variable myVariable is a Number object.
•The variable myVariable is an instance of the Number class.

즉 class 는 붕어빵 틀과 같은 틀을 말하고 object 나 instance 라는 말은 실제로 찍어낸 붕어빵들을 말합니다.


이벤트 핸들링
AS3.0 에서는 다음과같이 이벤트 리스너 메소드(=함수) 를 만들어놓고, addEventListener 라는 함수로 등록을 해줍니다.

function myEventResponse(event:MouseEvent):void
{
// myButton 이 클릭되었을때 실행할 동작 구현...
}

myButton.addEventListener(MouseEvent.CLICK, myEventResponse);


DisplayObject 계층구조 (신명용 강사님의 세미나 자료 내용)
AS3.0 으로 Flash 를 제대로 다루려면, 다음 구조를 정확히 알고있어야 합니다.

MovieClip Inheritance Sprite Inheritance DisplayObjectContainer Inheritance InteractiveObject Inheritance DisplayObject Inheritance EventDispatcher Inheritance Object

Object  최상위 객체 - 모든 클래스는 Object를 상속
EventDispatcher
 이벤트 발생기
 addEventListner(이벤트타입, 리스너함수);
 removeEventListener(이벤트타입, 리스너함수);
 dispatchEvent(이벤트)
DisplayObject
 눈에 보이는 객체 : Graphics, Bitmap, Shape
 x, y, width, height, alpha, rotation, visible,
 mouseX, mouseY, scaleX, scaleY
 (AS1.0에서는 속성들 앞에 _ 가 붙었으나 이젠 붙이지 않음)
InteractiveObject
 사용자에 반응하는 객체
 SimpleButton, TextField
DisplayObjectContainer
 다른 객체를 포함할 수 있는 객체 (Sprite, Stage, Loader)
 담긴객체 : child, 담는객체 : parent, 깊이 : index
 mouseChildren, numChildren, tabChildren
 contains(), addChild(), addChildAt(), removeChild(),
 removeChildAt(), getChildIndex(), getChildAt(),
 setChildIndex()
Sprite
 프레임이 없는 무비클립
 buttonMode, graphics, hitArea, soundTransform ...
 startDrag(), stopDrag()
MovieClip
 프레임을 가진 Sprite


Posted by 알 수 없는 사용자