Posted by 알 수 없는 사용자

타임라인 기반 플래시에서 easing 이라고 불렸던, 기타 애프터이펙트나 3D 프로그램들의 애니메이션 그래프에서 볼 수 있는
부드러운 가/감속 기능을 구현해 놓은 클래스 입니다. 어떤 인터렉션 작업을 하던 필수적으로 사용되므로 꼭 알아놓아야 할
클래스 중에 하나입니다.

기본적으로는 Adobe 에서 구현해놓은 Tween 클래스가 이미 flash 에 내장이 되어있습니다만, 퍼포먼스를 이보다 개선한 클래스들이 몇 있습니다. 그중 널리 사용되는 유명한 클래스가 caurina tweener 이고, 다른하나는 tweenmax 입니다.

Caurina Tweener
http://code.google.com/p/tweener/

TweenMax
http://blog.greensock.com/tweenmaxas3/


Posted by 알 수 없는 사용자



CS4의 Preferences 의 ActionScript 3.0 Settings 메뉴는 CS3와 달리
위 화면과 같이 세가지로 구분이 되어있습니다. 아래 설명은 Adobe Help 에서 찾은 설명입니다. 참고하세요.
즉 .as 로 존재하는 library 들은 위와같이 첫번째 source path 에 경로를 지정해주면 되고,
.swc 로 존재하는 library 들은 두번째의 library path 에 경로를 지정해주면 됩니다.

이렇게 flash의 Preferences 에서 설정한 라이브러리는 모든 flash파일에 공통적으로 적용이 되고 사용할 수 있으므로, Papervision3D 와 같은 라이브러리는 여기서 설정하여 사용할 수 있게 하면 좋겠죠. (Application level)

각 flash파일에서만 필요한 라이브러리는 해당 파일의 publish setting 화면에서 ActionScript 3.0 Setting 에서 path를 지정해 줄 수 있습니다. (Document level)

Set the location of ActionScript files

To use an ActionScript class that you’ve defined, Flash must locate the external ActionScript files that contain the class definition. The list of folders in which Flash searches for class definitions is called the classpath for ActionScript 2.0 and the source path for ActionScript 3.0. Classpaths and source paths exist at the application (global) or document level. For more information about classpaths, see Classes in Learning ActionScript 2.0 in Adobe Flash or “Packages” in Programming ActionScript 3.0.


You can set the following ActionScript locations in Flash:

  • ActionScript 2.0

    • Application level (available to all AS2 FLA files):

      • Classpath (set in ActionScript preferences)

    • Document level (available only to the FLA file that specifies this path):

      • Classpath (set in Publish Settings)

  • ActionScript 3.0

    • Application level (available to all AS3 FLA files):

      • Source path (set in ActionScript preferences)

      • Library path (set in ActionScript preferences)

      • External library path (set in ActionScript preferences)

    • Document level (available only to the FLA file that specifies these paths):

      • Source path (set in Publish Settings)

      • Library path (set in Publish Settings)

      • External library path (set in Publish Settings)

      • Document class (set in Document Property inspector)

In ActionScript 3.0, there are two additional paths that you can set to specify the locations of ActionScript resources.

The Library path specifies the location of pre-compiled ActionScript code which resides in SWC files you have created. The FLA file that specifies this path loads every SWC file at the top level of this path and any other code resources that are specified within the SWC files themselves. If you use the Library path, be sure none of the compiled code in the SWC files is duplicated in uncompiled AS files in the Source path. The redundant code will slow down compilation of your SWF file.

The External Library path specifies the location of SWC files that contain code used for compiler error definitions. This path can be used to load external code resources in SWC format so that the classes within them can be used at runtime. When you compile a SWF, the SWC files in the External Library path are not added to the SWF file, but the compiler verifies that they are in the locations you specified. The External Library path is most often used for runtime shared libraries. For more information about runtime shared libraries, see Working with runtime shared assets. For more information about loading external code at runtime, see Programming ActionScript 3.0.

For each type of resource path, you can specify more than one path for Flash to look in. Resources found in any of the paths specified will be used.

Posted by 알 수 없는 사용자

1. Papervision3D 설치

Papervision3D Google Code - Download 에서 Papervision3D 라이브러리 zip 파일을 받을 수 있습니다.
http://code.google.com/p/papervision3d/

받으신 압축파일은 데스크탑이나 기타 위치에 풀어놓으면 됩니다.
(아래의 경우는 Papervision3D_2.0.869 라는 폴더)

Flash 의 Preference - ActionScript - ActionScript 3.0 Settings 에서 다음과 같이 해당 폴더를 지정해 줍니다.
이렇게 하면 Flash 에서 Papervision3D 에 정의/구현 되어 있는 DisplayObject3D, ViewPort3D 등 3D 관련
Class 들을 사용 할 수 있게 됩니다. 

CS3 에서 설정방법



CS4 에서 설정방법



2. 샘플 코드 실행
많은 Papervision3D의 샘플코드들을 받아보면 Document Class 방식으로 되어있어 .as 파일만 존재합니다.
따라서, 이를 실행해보기 위해서는 신규 AS3.0 의 fla 파일을 만들어 해당 class 를 지정해 주어야 합니다.
즉 .as 파일을 실행하기 위한 껍데기(?)가 필요한 것입니다.

다음 예제파일을 실행해 보도록 하겠습니다.
http://pv3d.org/2009/02/03/internal-carousel/

다음과 같이 일단 .as 파일을 flash 에서 오픈합니다.



새 Flash 파일을 만듭니다. (AS3.0으로)


새파일을 .as 파일이 있는 폴더에 같이 저장합니다. (fla 로저장되겠죠. 이름은 상관 없습니다)
저장 후, 우측의 Properties 탭에서 Class 라는 부분의 필드에 해당 .as 의 파일명 (=클래스명)을 입력해 줍니다.
이때 .as 는 입력하지 않습니다.
CS3 에서는 화면 아래쪽에 Document Class 라는 필드가 있습니다.


입력후 우측의 연필모양의 버튼을 눌렀을때 .as 파일이 잘 열리면 제대로 연결 지정이 된 겁니다.
즉 새로만든 Test.fla 파일은 지정한 InternalCarousel 이라는 클래스를 사용하여 동작한다고 명시를 해 준 것입니다.


실행을해봅니다. 실행이 되지 않으면 output 창의 로그를 확인하세요. 주로 Papervision3D 라이브러리 패스가
올바르게 설정되지 않은 경우가 많습니다.


Posted by 알 수 없는 사용자
CS3 /AS3.0 이후의 큰 특징중 하나인 Document Class 라는 개념입니다.
코드부분이 완전히 분리되어서 별도의 독립적인 파일이 존재합니다. .fla / .as

아래 영상을 참고하세요.
http://www.adobe.com/designcenter/video_workshop/?id=vid0129

Papervision3D 를 보시려면 Document Class 를 알고 시작하면 도움이 많이 됩니다.
아래는 Adobe Help 에 있는 설명입니다. 참고하세요.

Declare an ActionScript 3.0 document class

When you use ActionScript 3.0, a SWF file may have a top-level class associated with it. This class is called the document class. When the SWF is loaded by Flash Player, an instance of this class is created to be the SWF file's top-level object. This object of a SWF file can be an instance of any custom class you choose.

For example, a SWF file that implements a calendar component can associate its top level with a Calendar class, with methods and properties appropriate to a calendar component. When the SWF is loaded, Flash Player creates an instance of this Calendar class.

  1. Deselect all objects on the Stage and in the Timeline by clicking a blank area of the Stage. This displays the Document properties in the Property inspector.
  2. Enter the filename of the ActionScript file for the class in the Document Class text box in the Property inspector. Do not include the .as filename extension.
Note: You can also enter the Document Class information in the Publish Settings dialog box.

Posted by 알 수 없는 사용자