달력

4

« 2024/4 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
2011. 5. 18. 15:40

SWF 파일 사이즈의 축소 Enjoy/FLEX2011. 5. 18. 15:40


출처 : http://loudon23.blog.me/30034697717


 <?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Button label="버튼"/>
</mx:Application>

 

위의 코드를 실행 해 보면 용량이 243,860 bytes 이다. 

웹서비스에 올리기에는 단지 버튼 하나 들어갔을 뿐인데 용량이 꽤 크다;;

 

그래서 최적화 해보려고 정보를 찾아 봤다.

 

Flex 3 Help 내용을 보니

(http://livedocs.adobe.com/flex/3/html/performance_06.html#208825)

  1. 바이트 코드 옵티마이져 사용
  2. 디버그의 무효화
  3. strict 모드사용
  4. 링커의존 확인
  5. 사용하지 않는 클래스의 초기화의 방지
  6. 어셋의 외부화
  7. 매입 폰트에 대한 문자범위의 사용

이러한 방법이 있다고 한다.

 

그래서 하나씩 테스트 해보면서 용량 비교를 해봤다.

 

1. 바이트 코드의 옵티마이져 사용

바이트 코드 옵티마이져는  "플렉스 최적화 응용 프로그램의 합병과 구멍을 바이트 코드를 사용하여 swf 파일을 최적화합니다. 바이트 코드에서 중복을 제거 지침을 구멍을 최적화합니다.(The bytecode optimizer can reduce the size of the Flex application's SWF file by using bytecode merging and peephole optimization. Peephole optimization removes redundant instructions from the bytecode.)"  라고 하는데.. 뭔말인지 모르겠음;;;

 

사용방법 :

 mxmlc -optimize=true MyApp.mxml

 

용량비교

  • -optimize=true : 243,860 bytes 
  • -optimize=false : 284,336 bytes
    사용 한것과 안한 것의 차이가 40,000 bytes(약 15%) 정도 난다.

참고

  optimize 옵션은 기본값이 true 상태임. 구지 mxmlc 에서 설정 할 필요 없다는 말;;

 

 

 

2. 디버그의 무효화

VC++ app들을 보면 릴리즈버전과 디버그 버전을 만들수 있듯, swf도 마찮가지다. 릴리즈 버전으로 제작을 하면 용량이 줄어 든다.

 

사용방법 :

 mxmlc -debug=true MyApp.mxml

 

용량비교 :

  • -debug=true : 243,860  bytes (디버그 버전)
  • -debug=false : 150,645  bytes (릴리즈 버전)
    디버그 버전을 포함하면 93,215 bytes (약 40%) 정도 늘어난다.

참고

debug 옵션의 기본값은 mxmlc 컴파일러는 false, compc 컴파일러는 true 이다.

flex 빌더의 경우 기본값이 true이다.

 

* mxmlc(어플리케이션 컴파일러) - ActionScript 및 MXML 등의 원시 파일로부터 SWF만들 때 사용

* compc(컴퍼넌트 컴파일러) -  컴퍼넌트 원시 파일, 이미지, 스타일 시트등의 어셋 파일로부터 SWC 파일을 생성하는 경우에 사용

 

 

3. strict 모드 사용

strict 컴파일러 옵션을 true로 설정하면, 컴파일러는 import 된 패키지들이 사용되고 있는지를 검증합니다. import한 클래스가 사용되지 않는 경우에 컴파일러는 에러를 보고합니다.  그리고 컴파일시 타입의 체크도 실시합니다.

 

사용방법 :

 mxmlc -strict=true MyApp.mxml

 

용량비교 :

  • -strict=true : 243,860 bytes
  • -strict=false : 245,777  bytes
    strict 모드 사용 안한것에 비해 사용 한것이 1,917 bytes (약 1%)가 줄어든다.

 

4. 링커의존 확인

swf파일 사이즈를 축소하는 방법을 찾아 내려면 swf 파일에서 쓰이고 있는 actionscript 클래스의 리스트들을 확인 합니다. 확인 후에 원인이되는 링커의존관계를 끊고, 새로운 코드를 작성 합니다.

 

사용방법 :

 mxmlc -link-report 리포트파일명 MyApp.mxml

 

이 옵션을 실행하면 '리포트파일명'으로 된 파일이 하나 생성된다.  해당 파일을 열어보면 swf 파일 내에서 쓰이고 있는 actionscript 클래스 리스트들을 확인 할 수 있고. 해당 클래스들의 의존관계를 볼 수 있다.

 

like-report 파일 내용

<script name="C:\flex3sdk\frameworks\libs\framework.swc(mx/skins/ProgrammaticSkin)" mod="1141055632000" size="5807">
    <def id="mx.skins:ProgrammaticSkin"/>
    <pre id="mx.core:IFlexDisplayObject"/>
    <pre id="mx.styles:IStyleable"/>
    <pre id="mx.managers:ILayoutClient"/>
    <pre id="flash.display:Shape"/>
    <dep id="String"/>
    <dep id="flash.geom:Matrix"/>
    <dep id="mx.core:mx_internal"/>
    <dep id="uint"/>
    <dep id="mx.core:UIComponent"/>
    <dep id="int"/>
    <dep id="Math"/>
    <dep id="Object"/>
    <dep id="Array"/>
    <dep id="mx.core:IStyleClient"/>
    <dep id="Boolean"/>
    <dep id="Number"/>
    <dep id="flash.display:Graphics"/>
</script>

 

link-report 파일 내의 태그 설명

  • 태그명 - <script>
  • 설명 -  어플리케이션의 SWF 파일 작성에 사용되는 컴파일 단위명을 나타냅니다.컴파일 단위는 클래스, 함수, 이름 공간등의 일반 정의를 1 개이상 포함합니다.
    name 속성에는 스크립트의 격납원이 표시됩니다. 원시 파일 또는 SWC 파일(frameworks.swc 등)로 나타납니다.
    커멘드 라인으로 keep-generated=true 와 설정하면, 생성된 폴더의 모든 클래스가 이 파일의 스크립트로서 리스트 됩니다.
    size 속성에는 클래스의 사이즈가 바이트 단위로 나타납니다.
    mod 속성은 스크립트가 작성되었을 때의 타임 스탬프를 나타냅니다.
  • 태그명 - <def>
  • 설명 - 스크립트, 클래스, 함수 네임스페이스 등의 이름을 정의 합니다 
  • 태그명 - <pre>
  • 설명 - 현재의 정의를 링크 하기 전에 SWF 파일에 링크 할 필요가 있는 정의를 나타냅니다. 이 태그는 전제 조건을 의미합니다.
    클래스 정의의 경우, 이 태그는, 직접적인 부모클래스(flash.events:Event 등) 및 그 클래스를 구현하는 모든 인터페이스(mx.core:IFlexDisplayObject,mx.managers:ILayoutClient 등)을 나타냅니다.
  • 태그명 - <dep>
  • 설명 - 이 정의가 의존하고 있는 그 외의 정의를 나타냅니다(String,_ScrollBarStyle,mx.core:IChildList 등).
    이것은, 현재의 스크립트가 필요로 하는 정의에의 참조입니다. 
    다른 정의에 의존하고 있지 않는 스크립트 정의도 존재하므로 <script> 태그에 <dep> 자식 태그가 없는 것도 있습니다.
  • 태그명 - <ext>
  • 설명 - 링크 되지 않았던 어셋에 대한 의존을 나타냅니다.
    external-library-path,externs, 또는 load-externs 컴파일러 옵션을 사용해 어셋을 SWF 파일에 추가하면 이러한 의존관계(dependencies)가 링크 리포트에 표시됩니다.

 

5. 사용하지 않는 클래스의 초기화 방지

쉽게 말하자면 쓰지 않는 컨트롤을 swf에 로드 하지 마라는 말입니다.

아래의 예는 어플리케이션 전체에서 DataGrid 컨트롤이 없어도 DataGrid을 강제적으로 swf 파일에 포함하고 있습니다.

 <?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
 <mx:Script>
  <![CDATA[
   import mx.controls.DataGrid;  // 쓰지 않는데 import 되어 있음
  ]]>
 </mx:Script>
 <mx:Button label="버튼"/> 
</mx:Application>

 

용량비교 :

이것은 strict 모드로 하고 있으면 용량 비교가 되지 않는다. 이유는 위에 있는 strict를 보면 쓰이지 않는것은 애초에 포함을 안시키기 때문이다. 그래서 strict 모드를 끄고 테스트 하였다.

  • 쓰지 않는 DataGrid 임포트 전 - 245,768  bytes
  • 쓰지 않는 DataGrid 임포트 후 - 245,775  bytes 
    별차이를 모르겠음;; 테스트 잘못했는가??

 

6. 어셋의 외부화

Flex 어플리케이션으로 사용되는 외부화의 방법은 여러가지가 있습니다. 예를 들면, 다음과 같은 방법이 있습니다.

  • 모듈을 사용한다
  • 실행시 스타일 시트를 사용한다
  • 런타임 공유 라이브러리(RSL)을 사용한다
  • 어셋을 임베드 하지 않고 실행시에 로드한다

swf내에서 비트맵 이미지를 많이 포함 하고 있으면 당연히 용량이 커진다. 용량을 줄이기 위해서 실행시에 로드하도록 만들어야 한다. 

 <?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
   <!--

        <mx:Image source="http://imgnews.naver.com/image/001/2008/08/13/PYH2008081400270005100_P2.jpg" />

    -->
   <mx:Image source="@Embed(source='../assets/PYH2008081400270005100_P2.jpg')"/> 
</mx:Application>

 

이 코드에 보면 위에 꺼는 외부에서 불러오는것이고 아래 것은 swf에 임베드 하는것이다.

 

용량비교 :

  • 이미지 파일의 크기 - 31,648  bytes
  • 실행시 로드 - 252,853  bytes
  • 어셋 매입 - 285,559  bytes 
    어셋 매입에 비해 실행시 로드가 32,706 bytes(약 10%) 줄었다.

 

7.  매입 폰트에 대한 문자 범위의 사용

매입 폰트의 쓰이는 글자 범위를 지정하여 폰트 사이즈를 작게 하는 방법이다.

문자 범위는 flex-config.xml 또는 각 MXML 파일의 font-face 선언으로 설정 할 수 있다.

문자범위는 유니코드 값을 사용하고 개별 문자 또는 문자 범위를 지정가능하다.

 

지정방법 :

  css를 통한 방법

 @font-face {
    src:url("../assets/MyriadWebPro.ttf");
    fontFamily: myFontFamily;
    unicodeRange:
        U+0041-U+005A, /* Upper-Case [A..Z] */
        U+0061-U+007A, /* Lower-Case a-z */
        U+0030-U+0039, /* Numbers [0..9] */
        U+002E-U+002E; /* Period [.] */
}

 

 flex-config.xml 파일을 통한 방법

 <language-range>
    <lang>Latin I</lang>
    <range>U+0020,U+00A1-U+00FF,U+2000-U+206F,U+20A0-U+20CF,U+2100-U+2183</range>
</language-range>

 

 

용량비교 :

다음의 코드를 통해서 용량 비교를 테스트 했다.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
 <mx:Style>
  @font-face {
   src:url("../assets/tunga.ttf");
   fontFamily: tunga;   
   unicodeRange:
          U+0030-U+0039, /* Numbers [0..9] */
  }
 </mx:Style>
 <mx:Label text="1234567890" fontFamily="tunga" />
</mx:Application>

 

문자범위 지정 전 - 267,509  bytes

문자범위 지정 후 - 248,529  bytes

지정 전 보다 지정 한 후가 18,980 bytes (약 8%)정도 용량이 줄었다.

 

 

 

 

 

여러가지 방법이 있지만 이중에서 내가 느끼기엔 가장 효율이 좋은것은 어셋의 외부화이다. 그중에서도 특히 어셋의 외부화 - 런타임 공유 라이브러리(RSL)을 사용하는 것이다.  

RSL는 공통으로 쓰는 공유 라이브러리를 런타임때 호출 하는 방식이다. 윈도우에서 따지자면 공유 DLL 같은 방식이다. 

이것을 swf에 적용 한다면, FLEX에서 쓰는 Framework를 외부 파일로 빼내서 런타임때 불러서 쓰는 것이다.  뭐... 다르게 말하자면 .net framework 처럼 쓴다고 할까나?? (맞는 비유일까;;;)

:
Posted by 라면스프

출처 : http://loudon23.blog.me/30034706962


swf 용량을 줄이는 방법중에서 가장 나은 방법이 Flex Framework 를 런타임 공유 라이브러리(RSL)로 만드는 것이다.

 

RSL는 아래 그림 두곳에서 쓰는 공통되는 모듈을 하나의 모듈로 빼서 실행시에 호출 해서 쓰는 것을 말한다.

 

 

 

framework rsl를 만드는 방법은 간단하다.

 

1. Navigator 뷰에서 해당 프로젝트를 선택

2. 선택 된 프로젝트에서 마우스 오른쪽 버튼 클릭

3. Properties  선택

4. Properties창에서 [Flex Build Path] - [Library Path] 선택

5. 아래의 그림 처럼 Framework linkage 를 Runtime shared Library(RSL)을 선택

 

 

bin-debug 폴더 또는 bin-release 폴더를 보면

framework_해당버전.swf

framework_해당버전.swz

파일이 생성된것을 볼 수 있다. 두 파일의 차이점은

 

.swf 

  • 서명 없는 framework RSL 
  • 허가된 도메인만 해당 RSL 모듈을 사용가능
  • 브라우저 캐쉬

         

.swz

  • 서명 있는 framework RSL
  • Adobe 만 제작 가능
  • 도메인에 관계없이 임의의 어플리케이션에서 엑세스 가능
  • 플래시 플레이어에 의해 캐쉬

 

여기서 플래시 플레이어 캐쉬 위치는 아래를 참조하시길...

 

 플랫폼

플래시 플레이어 캐쉬 저장 장소 

 Windows

 95/98/ME/

 2000/XP

C:\Documents and Settings\user_name\Application Data\Adobe\Flash Player\AssetCache\

 Windows

  Vista

C:\Users\user_name\AppData\Roaming\Adobe\Flash Player\AssetCache\
 Linux /home/user_name/.adobe/Flash_Player/AssetCache/
 Mac OSX /Users/user_name/Library/Cache/Adobe/Flash Player/AssetCache/

 

 

 

이렇게 만들어진 swf 파일의 크기비교를 해보았다.

 

 <?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
     <mx:Button label="버튼" />
</mx:Application>

 

 

용량비교 :

  • RSL 전 - 243,864  bytes
  • RSL 후 -   72,365  bytes
  • framework.swf 크기 (3.0.0.477 버전 기준) -  535,001  bytes
    RSL 전보다 RSL를 적용한 후가 171,499 bytes (약 70%) 정도의 용량을 줄여졌다
:
Posted by 라면스프
2010. 12. 23. 10:37

[FLEX] httpText a 링크 걸기 Enjoy/FLEX2010. 12. 23. 10:37

flex엔 httpText 가 있더군요.
a 링크 코드 를 입력 사용 가능하더군요.


:
Posted by 라면스프
2010. 7. 9. 13:33

사용자 정의 컴포넌트 만들기 Enjoy/FLEX2010. 7. 9. 13:33

http://help.adobe.com/en_US/Flex/4.0/UsingSDK/WS2db454920e96a9e51e63e3d11c0bf68268-7ffb.html

MXML 또는 ActionScript 파일로 사용자 정의 컴포넌트를 만들 수 있습니다.

MXML component 만들기

플렉스는 고객이 주소 정보를 입력할때 사용할 수 있는 Spark ComboBox를 제공하고 있습니다. 폼에서 미국내 50개 주의 목록에서 선택할 수 있도록 ComboBox를 포함할 수 있습니다. 사용자가 주소를 입력할 수 있는 여러개의 폼이 있는 어플리케이션에서 50개 주에 대한 동일한 정보로 여러 개의 ComboBox 컨트롤을 반복해서 생성하고 초기화 시키는 작업은 지루한 것입니다.

대신 50개 주가 사전에 세팅되어 있는 ComboBox 컨트롤을 포함하는 하나의 MXML 컴포넌트를 만들 수 있습니다. 그럼 어플리케이션 어디에서든지 이 MXML 컴포넌트를 사용하여 주를 선택할 수 있는 기능을 추가할 수 있습니다. 다음은 사용자 정의 ComboBox 컨트롤에 대한 예시를 보여줍니다.

<?xml version="1.0"?>
<!-- createcomps_intro\StateComboBox.mxml -->
<!-- Specify the root tag and namespace. -->
<s:ComboBox xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<s:dataProvider>
<s:ArrayList>
<fx:String>AK</fx:String>
<fx:String>AL</fx:String>
<!-- Add all other states. -->
</s:ArrayList>
</s:dataProvider>
</s:ComboBox>

이 예제는 다음과 같은 내용을 보여줍니다.

  1. 사용자 정의 MXML 컴포넌트 정의의 첫 번째 라인은 XML 버전을 선언합니다.

  2. root  태그라고 불리는 컴포넌트의 첫 번째 MXML 태그는 플렉스 컴포넌트 또는 사용자 정의 컴포넌트을 명시합니다. 따라서 MXML 컴포넌트는 ActionScript 클래스에서와 비슷하게 MXML 컴포넌트의 슈퍼클래스를 루트 태그에서 지정합니다. 이 예제에서 MXML 컴포넌트의 슈퍼 클래스로 플렉스 ComboBox 컨트롤을 지정합니다.

  3. 루트 태그에 xmlns 속성은 플렉스의 XML 네임 스페이스를 지정합니다. 이 예제에서는 xmlns 속성은 접두사 mx:를 사용하는 MX 네임 스페이스에 해당하는 태그를 나타냅니다.

  4. 컴포넌트의 나머지 라인은 컴포넌트에 대한 정의입니다.

다음 예제에서는 메인 어플리케이션이나 다른 MXML 컴포넌트 파일에서  StateComboBox 컴포넌트를 참조하는 것을 보여줍니다.

<?xml version="1.0"?>
<!-- createcomps_intro/IntroMyApplication.mxml -->
<!-- Include the namespace definition for your custom components. -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:MyComp="*">

<!-- Use the filename as the MXML tag name. -->
<MyComp:StateComboBox/>
</s:Application>


이 예제에 대한 실행 swf파일은 아래에 있습니다.

SWF파일 링크
 

사용자 지정 컴포넌트에 대한 MXML 태그 이름은 두 부분으로 구성되어 있습니다. 네임 스페이스 접두사(이 경우에는 MyComp) 와 태그 이름입니다. 네임 스페이스 접두사는 사용자 지정 컴포넌트를 구현하는 파일을 어디에서 찾아야 하는지 플랙스에게 알려줍니다. 태그 이름은 (이 경우에는 StateComboBox.mxml에 해당) 컴포넌트의 파일이름에 기초합니다. 따라서 StateComboBox.mxml 파일이 <namespace:StateComboBox>의 태그 이름을 가진 컴포넌트를 정의합니다.
 
<s:Application> 태그에서 메인 어플리케이션 파일은 다음 네임 스페이스 정의 xmlns:MyComp ="*"를 포함합니다. 이 정의는 그 컴포넌트가 기본 어플리케이션 파일이 있는 디렉토리 또는 ActionScript 소스 경로에 포함된 디렉토리에 있다는 것을 명시합니다. MXML 컴포넌트 배포에 대한 자세한 내용은 Simple MXML components를 참조하십시오.

어플리케이션의 하위 디렉터리에 사용자 정의 컴포넌트를 넣는 것이 가장 좋은 방법입니다. 그것들은 각자 다른 네임 스페이스를 가지고 있기 때문에 컴포넌트 이름이 중복되지 않도록 하는데 많은 도움이 될것입니다. 어플리케이션의 myComponents라는 하위 디렉터리에 컴포넌트를 저장하면 네임 스페이스는 xmlns:MyComp="myComponents.*"가 될 것입니다.

StateComboBox.mxml 파일의 루트 태그로 ComboBox 컨트롤을 지정했으므로, 사용자 정의 컴포넌트의 MXML 태그에서 또는 ActionScript <fx:Script> 태그에서 ComboBox 컨트롤의 모든 속성을 참조할 수 있습니다. 예를 들어 다음 예제는 ComboBox.maxChars 속성과 ComboBox.close 이벤트 리스너를 지정하는 것을 보여줍니다.
<?xml version="1.0"?>
<!-- createcomps_intro/MyApplicationProperties.mxml -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:MyComp="myComponents.*">

<fx:Script>
<![CDATA[
import flash.events.Event;

private function handleCloseEvent(eventObj:Event):void {
// ...
}
]]>
</fx:Script>

<MyComp:StateComboBox maxChars="25"
close="handleCloseEvent(event);"/>
</s:Application>

 

이 예제에 대한 실행 swf파일은 아래에 있습니다.

SWF파일 링크

MXML componrnt에 대한 자세한 내용은 Simple MXML components 참조하십시오.

ActionScript 컴포넌트 만들기

ActionScript 클래스를 정의하여 ActionScript 컴포넌트를 만들 수 있습니다. ActionScript에서 다음과 같은 유형의 componrnt를 만들 수 있습니다.
User-interface, visual, components
사용자 인터페이스 컴포넌트는 처리 논리와 시각적인 요소 모두를 포함하고 있습니다. 기존의 동작을 수정하거나 컴포넌트에 새로운 기능을 추가하는 사용자 지정 사용자 인터페이스 컴포넌트를 만듭니다. 이러한 컴포넌트는 일반적으로 플렉스 컴포넌트 계층 구조를 확장합니다. UIComponent 클래스 또는 Button, ComboBox, DataGrid와 같은 플렉스 컴포넌트를 확장할 수 있습니다. 사용자 정의 ActionScript 컴포넌트의 모든 메서드와 속성, 이벤트, 스타일, 효과는 super클래스로부터 상속 받습니다.
 
Nonvisual components
Nonvisual 컴포넌트는 비시각적 요소를 정의합니다. 플렉스는 formatters, validators, effects를 포함한 nonvisual 컴포넌트의 몇 가지 유형이 있습니다. 플렉스 컴포넌트 구조로부터 하위 클래스를 만들어 nonvisual 컴포넌트를 만들 수 있습니다. validator의 경우 Validator 클래스의 하위 클래스를 만들고 formatter의 경우 Formatter클래스의 하위클래스를 만들고 effect의 경우Effect클래스의 하위 클래스를 만들어 컴포넌트를 만듭니다.

예를 들어 사용자 정의 버튼 컴포넌트를  Spark Button 클래스를 기반으로 정의할 수 있다는 것을 다음 예제로 보여줍니다 :

package myComponents
{
// createcomps_intro/myComponents/MyButton.as
import spark.components.Button;

public class MyButton extends
Button {

// Define the constructor.
public function MyButton() {
// Call the constructor in the superclass.
super();
// Set the label property to "Submit".
label="Submit";
}
}
}

예제에서는 MyButton.as 파일에 MyButton 클래스를 작성합니다.

ActionScript 패키지 내에서 사용자 지정 컴포넌트를 정의해야합니다. 패키지는 어플리케이션의 디렉터리 구조에 컴포넌트의 디렉토리 위치를 반영합니다. 일반적으로 ActionScript 소스 경로에있는 어플리케이션의 하위 디렉토리나 또는 Adobe® LiveCycle™ Data Services ES를 위한 WEB-INF/flex/user_classes 디렉터리에 사용자 정의 ActionScript의 컴포넌트를 넣어둡니다. 이 예제에서는 패키지는 MyButton.as 파일이 플렉스 어플리케이션의 하위 디렉터리인 myComponents에 있다는 것을 나타냅니다.
 
다음 예제는 사용자 정의 컴포넌트를 참조하는 MXML 파일에서 네임 스페이스를 정의하고 MXML 파일에서 그것을 참조하는 방법을 보여줍니다. 
 
<?xml version="1.0"?>
<!-- createcomps_intro/MyApplicationASComponent.mxml -->
<!-- Include the namespace definition for your custom components. -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:s="library://ns.adobe.com/flex/spark" 
    xmlns:mx="library://ns.adobe.com/flex/mx" 
    xmlns:MyComp="myComponents.*">

    <!-- Use the filename as the MXML tag name. -->
    <MyComp:MyButton/>

</s:Application>
 
이 예제에 대한 실행 swf 파일은 아래에 있습니다.
SWF파일 링크
 
이 예제에서는 먼저 어플리케이션의 디렉토리 구조에서 사용자 정의 컴포넌트의 위치를 명시하는 MyComp 네임 스페이스를 정의합니다. 그런 다음 네임스페이스 접두사를 사용하는 MXML의 태그로 컴포넌트를 참조합니다.
 
자세한 내용은 Create simple visual components in ActionScript를 참조하십시오.

컴포넌트 배포

MXML이나 ActionScript 파일로 사용자 정의 컴포넌트를 배포할 때 일반적으로 지정된 어플리케이션 파일과 같은 디렉토리나 ActionScript 소스 경로로 설정된 디렉토리, LiveCycle Data Services ES를 위한 WEB-INF/flex/user_classes 디렉토리 구조로 사용자 정의 컴포넌트를 배포합니다

보안상의 이유로 소스 코드 파일로 사용자 지정 컴포넌트를 배포하지 않기로 결정할 수도 있습니다. 이런 경우 SWC 파일이나  Runtime Shared Library (RSL)의 일부로 컴포넌트를 배포할 수있습니다.

SWC 파일은 플렉스 컴포넌트에 대한 아카이브 파일입니다. SWC 파일은 플렉스 개발자들 사이에 컴포넌트를 쉽게 주고 받을 수 있도록 합니다. MXML 이나 ActionScript 파일, 이미지 및 기타 리소스 파일 대신 swc파일 하나만 전달하면 됩니다. 또한 컴파일된 SWF 파일을 SWC 파일 내부에 담고 있어서 그 코드가 외부로 노출되지 않습니다.

SWC 파일은 하나 이상의 컴포넌트를 포함하는 PKZIP 압축 형식으로 압축하거나 풀수 있는 파일입니다. SWC은 WinZip, JAR 또는 다른 압축 도구를 사용하여 파일을 확인해 볼 수 있습니다. 그러나 수동으로 SWC 파일의 내용을 변경해서는 안됩니다. SWC 파일 내부의 SWF 파일을 SWC외부에서 실행하려고 해서도 안됩니다.

SWC 파일을 만들기 위해서는 flex_install_dir/bin 디렉토리에 있는 compc 유틸리티를 사용합니다. compc 유틸리티는 MXML/ActionScript  componrnt 소스 파일에서 SWC 파일을 생성 합니다. compc에 대한 자세한 내용은 Flex compilers를 참조하십시오.

application의 SWF 파일 크기를 줄이는 한 가지 방법은 별도로 다운로드되어 클라이언트 캐시에 남아있게 되는 stand-alone file에 공통으로 사용되는 자원을 객관화(externalizing)하는 것입니다. 이러한 공유 자원은 런타임에 여러 어플리케이션에서 수차례 로드가 시도되어도 클라이언트측에는 단 한번만 전송됩니다. 이 공유 파일은 Runtime Shared Libraries 또는 RSLs로 알려져 있습니다.

RSL 파일을 만드는 방법을 포함한 자세한 내용은 Runtime Shared Libraries를 참조하십시오.
:
Posted by 라면스프
2010. 5. 28. 15:12

Manually adding drag-and-drop support Enjoy/FLEX2010. 5. 28. 15:12



Manually adding drag-and-drop support


To support drag-and-drop operations with non-list-based controls, or with containers, you must explicitly add support by using a series of special classes and events.


Example: Simple drag-and-drop operation

The following example lets users color a canvas by dropping either of two sample colors onto it. It shows the basic elements of a drag-and-drop operation. The following sections describe these elements in greater detail.

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

    <mx:Script>
    <![CDATA[
        import mx.core.DragSource;
        import mx.managers.DragManager;
        import mx.events.*;
        import mx.containers.Canvas;

        // Called when the user clicks the mouse on either colored canvas.
        // Initializes the drag.
        private function dragIt(event:MouseEvent, text:String,
format:String):void { // Get the drag initiator component from the event object. var dragInitiator:Canvas=Canvas(event.currentTarget); // Create a DragSource object. var ds:DragSource = new DragSource(); // Add the data to the object. ds.addData(text, format); // Create a Canvas container to use as the drag proxy. // You must specify a size for the proxy image, // or else it will not appear. var canvasProxy:Canvas = new Canvas(); canvasProxy.width=30; canvasProxy.height=30; canvasProxy.setStyle('backgroundColor',
dragInitiator.getStyle('backgroundColor')); // Call the DragManager doDrag() method to start the drag. // For information on this method, see // the "Initiating the drag" section. DragManager.doDrag(dragInitiator, ds, event, canvasProxy); } // Called if the user dragged a proxy onto the drop target canvas. private function doDragEnter(event:DragEvent):void { // Get the drop target component from the event object. var dropTarget:Canvas=Canvas(event.currentTarget); // Accept the drag only if the user is dragging data // identified by the 'color' format value. if (event.dragSource.hasFormat('color')) { DragManager.acceptDragDrop(dropTarget); } } // Called if the target accepts the dragged object and the user // releases the mouse button while over the canvas. // Handles the dragDrop event for the List control. private function doDragDrop(event:DragEvent):void { // Get the data identified by the color format from the drag source. var data:Object = event.dragSource.dataForFormat('color'); // Set the canvas color. myCanvas.setStyle("backgroundColor", data); } ]]> </mx:Script> <!-- A horizontal box with red and green canvases the user can drag --> <mx:HBox> <mx:Canvas backgroundColor="red" borderStyle="solid" width="30" height="30" mouseMove="dragIt(event, 'red', 'color');"/> <mx:Canvas backgroundColor="green" borderStyle="solid" width="30" height="30" mouseMove="dragIt(event, 'green', 'color');"/> </mx:HBox> <mx:Label text="Drag the item into this canvas"/> <!-- Handles dragEnter and dragDrop events to allow dropping --> <mx:Canvas id="myCanvas" backgroundColor="#FFFFFF" borderStyle="solid" width="100" height="100" dragEnter="doDragEnter(event);" dragDrop="doDragDrop(event);"/> </mx:Application>
:
Posted by 라면스프
2010. 5. 28. 11:29

Using the ToolTip Manager Enjoy/FLEX2010. 5. 28. 11:29



Enabling and disabling ToolTips



<?xml version="1.0"?>
<!-- tooltips/ToggleToolTips.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

  <mx:Script><![CDATA[
     import mx.managers.ToolTipManager;

     private function toggleToolTips():void {
        if (ToolTipManager.enabled) {
           ToolTipManager.enabled = false;
        } else {
           ToolTipManager.enabled = true;
        }
     }
  ]]></mx:Script>

  <mx:Button id="b1"
    label="Toggle ToolTips" 
    width="150" 
    click="toggleToolTips();" 
    toolTip="Click me to enable/disable tooltips."
  />
  
</mx:Application>

Using effects with ToolTips


<?xml version="1.0"?>
<!-- tooltips/FadeInToolTips.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="600" height="600" initialize="app_init();">

  <mx:Script><![CDATA[
     import mx.managers.ToolTipManager;
     public function app_init():void {
        ToolTipManager.showEffect = fadeIn;
     }
  ]]></mx:Script>

  <mx:Fade id="fadeIn" alphaFrom="0" alphaTo="1" duration="1000"/>

  <mx:Button id="b1" label="Click Me" toolTip="This is a ToolTip that fades in."/>

</mx:Application>
:
Posted by 라면스프
2010. 5. 28. 11:20

51가지 AS3, Flex 테크닉 & 예제 Enjoy/FLEX2010. 5. 28. 11:20


출처 : http://www.insideria.com/2009/04/51-actionscript-30-and-flex-op.html



51 ActionScript 3.0 and Flex optimization techniques and practices

Author photo
|  | Comments (30)
AddThis Social Bookmark Button

A homework assignment I was recently given for a Java programming class involved a competition to see who could create the most optimized implementation of an interface which was provided by the instructor. It was a challenging and very fun assignment that I think the whole class enjoyed. I didn’t win the competition but still came out a winner because of my heightened interest in application optimization and performance tuning that I gained.

I’m personally a pretty big fan of coding standards and have been ribbed by many developers over some of the longer method, variable and class names that I sometimes choose. I've always leaned toward the side of programming that employs standards and frameworks . Rather than spending a ton of time digging around in compiler specs and messing with GC (Garbage Collection) for reasons of performance, tuning and optimization. I was leaving this to the seasoned programmers creating the standards and frameworks I use.

This isn’t to say I’ve never paid attention to performance and I enjoy building slow applications. It’s almost like two different worlds; the optimization world and the standards world. They don’t always agree with each other. There can sometimes be a trade off for performance over readability and organization or vice-versa. This article is meant to stand next to the Flex Best Practices articles that I authored.

While creating my concrete implementation for the homework assignment I discovered a powerful profiling engine in NetBeans. The NetBeans profiling engine helped me understand some of the memory usage and consumption of each property, method call and object instantiation in my program. This profiler in NetBeans is very similar to the one found in Flex Builder. Both are very powerful and very useful. I've been exploring the Flex Profiler in greater detail lately as well and using it to eradicate memory leaks for a real world application I’ve been refactoring to best practices lately.

The Java optimization homework has increased my interest in optimization and profiling for ActionScript 3.0 and Flex development. I've been piecing together ActionScript optimization techniques and practices from around the web for a couple years now. Some of these techniques are in opposition to what the standards dictate but most of software development is this way. You have to learn when to use some techniques and when to leave some out.

Here are 51 ActionScript 3.0 and Flex optimization techniques and practices. I’ve scoured the web for and filtered practices and techniques that can be adopted into your application development process. Use these in conjunction with the Flex Profiler to monitor and optimize and tune the performance of your ActionScript 3.0 and Flex RIAs.

1. Avoid the new operator when creating Arrays

 
var a = [];

NOT:

 
var a = new Array();

2. Arrays are expensive to create, do so conservatively

 
var vanityCollection01 : Array = new Array();
var vanityCollection02 : Array = new Array();
var vanityCollection03 : Array = new Array();
var vanityCollection04 : Array = new Array();

3. Fastest way to copy an array:

 
var copy : Array = sourceArray.concat();

4. Setting values in Arrays is slow

 
employees.push( employee );
employees[2] = employee;

5. Getting values from Arrays is twice as fast as setting

 
var employee : Employee = employees[2];

6. Anonymous objects are faster to create with {} vs. new

 
var o : * = { firstName : "John", lastName : "Smith", age : 45 };
NOT:
var p : Person = new Person();
p.firstName = "John";
p.lastName = "Smith";
p.age = 45;

7. Use static for properties methods that do not require an object instance

 
StringUtils.trim( "text with space at end " );
Class definition:
package
{
public final class StringUtils
{
public static function trim( s : String ) : String
{
var trimmed : String;
// implementation...
return trimmed;
}
}
}

8. Use const for properties that will never change throughout the lifecycle of the application

 
public const APPLICATION_PUBLISHER : String = "Kannopy, Inc.";

9. Use final when no subclasses need to be created of a class

 
public final class StringUtils

10. Use package level variables and functions for generalized functionality which does not require a class or instance of a class

 
createSnapShot( arg );

NOT:

 
someObjectInstance.createSnapShot( arg );

NOT:

 
SomeClass.createSnapShot( arg );
Class definition:
package
{
// imports&#133;;
public function createSnapShot(target:IBitmapDrawable) : Bitmap
{
// implementation&#133;
}
}

11. JIT won’t compile code within constructors (keep them lightweight)

 
package com.seantheflexguy.as3optimization
{
public class MinimalConstructor
{
public function MinimalConstructor()
{
init();
}

}
}

12. Length of method/variable names doesn't matter in ActionScript 3.0 (true in other langs)

 
someCrazyLongMethodNameDoesntReallyImpactPerformanceTooMuch();

13. One line assignments DO NOT buy any performance! It's a Myth! (true in other langs)

 
var i=0; j=10; k=200;

14. No difference in memory usage between an if statement and a switch statement

 
if ( condition )
{
// handle condition
}

IDENTICAL MEMORY USAGE:

 
switch ( condition )
{
case "A":
// logic to handle case A
break;

case "B":
// logic to handle case B
break;
}

15. Rank your if statements in order of comparisons most likely to be true

 
if ( conditionThatHappensAlot )
{
// logic to handle frequently met condition
}
else if ( conditionThatHappensSomtimes )
{
// handle the case that happens occaisonally
}
else
{
// handle the case that doesn&#8217;t happen that often
}

16. AVM promotes int to Number during calculations inside loops

17. Resolve issues of promotion, unknown, or incorrect object types

18. Use uint sparingly, it can be slow

 
var footerHex : uint = 0x00ccff;

19. Use integers for iterations

 
(var i: int = 0; i < n; i++) NOT for (var i: Number = 0; i < n; i++)

20. Cast to int for calculations inside loops (AVM automatically promotes int to Number)

 
for (;i<n2;i++) Vector3D(array[int(i*2)]).x = 2;

NOT:

  
for (;i<n2;i++) Vector3D(array[i*2]).x = 2;

21. Don't use int with decimals

 
var decimal : Number = 14.654;

NOT:

 
var decimal : int = 14.654;

22. Multiply vs. Divide: instead of 5000/1000 use: 5000*0.001

23. Calculate things like floor and round yourself vs. calling Math library

 
package com.seantheflexguy.math
{
public final class MathUtil
{
public static function round( number : Number ) : Number
{
// custom rounding implementation
}
}
}

24. Locally store function values in for and while statements instead of repeatedly accessing them

 
for (..){a*180/Math.PI;}
declare: toRadians = a*180/Math.PI; outside of the loop

25. Avoid calculations and method calls in loops

 
for (var i=0;i< myArray.lengh;i++){ }

NOT:

  
var len : int = myArray.lengh;
for (var i=0;i<len;i++){}

26. Remove event listeners when finished using them

 
removeEventListener( Event.COMPLETE, onComplete );

27. Use delete to free memory

 
delete someObject;

28. Use RegEx for validation, use string methods for searching

 
// postal code validation example using regular expressions
private var regEx:RegExp = /^[A-Z][0-9][A-Z] [0-9][A-Z][0-9]$/i;
private function validatePostal( event : Event ) : void
{
if( regEx.test( zipTextInput.text ) )
{
// handle invalid input case
}
}

// search a string using String methods
var string : String = "Search me";
var searchIndex : int = string.indexOf( "me" );
var search : String = string.substring( searchIndex, searchIndex + 2 );

29. Reuse objects to maintain a “memory plateau” DisplayObjects, URLLoader objects

30. Follow the Flex component model:

 
createChildren();
commitProperties();
updateDisplayList();

31. Only use Datagrids as a last resort (make sure you can’t implement in a regular List first)

32. Avoid Repeaters for scrollable data

33. Avoid the setStyle() method (One of the most expensive calls in the Flex framework)

34. Using too many containers dramatically reduces the performance of your application

 
<mx:Panel>
<mx:VBox>
<mx:HBox>
<mx:Label text="Label 1" />
<mx:VBox>
<mx:Label text="Label 2" />
</mx:VBox>
<mx:HBox>
<mx:Label text="Label 3" />
<mx:VBox>
<mx:Label text="Label 4" />
</mx:VBox>
</mx:HBox>
</mx:HBox>
</mx:VBox>
</mx:Panel>

35. You do not need to always use a container tag as the top-level tag of components Totally valid component, no top level container needed:

 
<mx:Image xmlns:mx="http://www.adobe.com/2006/mxml"
source="avatar.jpg" width="200" height="200" />

36. Remove unnecessary container wrappers to reduce container nesting

37. Avoid: The VBox container inside an tag, (eliminates redundancy)

 
<mx:Panel>
<mx:Label text="Label 1" />
<mx:Label text="Label 2" />
</mx:Panel>
NOT:
<mx:Panel>
<mx:VBox>
<mx:Label text="Label 1" />
<mx:Label text="Label 2" />
</mx:VBox>
</mx:Panel>

38. Avoid: VBox container inside an tag, (eliminates redundancy)

 
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx=http://www.adobe.com/2006/mxml>
<mx:Label text="Label 1" />
<mx:Label text="Label 2" />
</mx:Application>

NOT:

 
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx=http://www.adobe.com/2006/mxml>
<mx:VBox>
<mx:Label text="Label 1" />
<mx:Label text="Label 2" />
</mx:VBox>
</mx:Application>

39. Set the recycleChildren property to true to improve a Repeater object's performance (re-uses previously created children instead of creating new ones)

 
<mx:Script>
<![CDATA[
[Bindable]
public var repeaterData : Array = ["data 1", "data 2"];
]]>
</mx:Script>

<mx:Repeater id="repeater" dataProvider="{repeaterData}">
<mx:Label text="data item: {repeater.currentItem}"/>
</mx:Repeater>

40. Keep framerate set at 60 fps or lower

 
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx=http://www.adobe.com/2006/mxml
frameRate="45">
</mx:Application>

41. Avoid multiple display manipulations per frame

42. Code against ENTER_FRAME events instead of Timer events

 
public function onEnterFrame( event : Event ) : void
{
}
private function init() : void
{
addEventListener( Event.ENTER_FRAME, onEnterFrame );
}

NOT:

 
public function onTimerTick( event : Event ) : void
{
}
private function init() : void
{
var timer : Timer = new Timer();
timer.start();
timer.addEventListener( TimerEvent.TIMER, onTimerTick );
}

43. To defer object creation over multiple frames use:

 
<mx:Container creationPolicy=&#8221;queued&#8221;/>

44. Alpha = 0 is not the same as visible = false (Objects marked invisible are passed over)

 
loginButton.visible = false;

NOT:

 
loginButton.alpha = 0;

45. Faster to perform operations locally than it is to call a function in the same class Even slower to call a function from a different class (This is referred to as “code inlining”.)

46. When executing a function it’s more expensive if you call other functions from within it

 
private function udpateUserRecord()
{
update( user.firstName + user.lastName );
}

NOT:

 
private function updateUserRecord() {
update( concatName() );
}
private function concatName() : String
{
return user.firstName + user.lastName;
}

47. Arguments in functions are slower than a reference to an objects variables

 
package com.seantheflexguy.as3optimization
{
public class DemoClassMemberVariables
{
// set the properties on class instances
public var userName : String;
// etc...
public function DemoClassMemberVariables()
{
}
private function login() : void
{
// login implementation logic
userName = creds.getUserName();
// etc...
}
}
}

NOT:

 
package com.seantheflexguy.as3optimization
{
public class DemoClassArguments
{
public function DemoClassArguments()
{
}
private function login( creds : Authentication ) : void
{
// login implementation logic
userName = creds.getUserName();
// etc...
}
}
}

48. Faster to use "as" vs. casting

 
var u : User = event.results.users.user as User;

NOT:

 
var u : User = User(event.results.users.user);

49. Use custom object types vs new Object();

 
var v3D : Vector3D = new Vector3D();
v3D.x = 100;
v3D.y = 450;
v3D.z = 500;

NOT:

 
var v3DObject : Object = new Object();
v3DObject.x = 100;
v3DObject.y = 450;
v3DObject.z = 500;

50. Use casting to inform the Flash player what kind of objects are inside an Array

 
for (i=0;i<n;i++)
{
Vector3D( array[i] ).x = 2;
}

NOT:

 
for (i=0;i<n;i++)
{
array[i].x = 2;
}

51. Check for null instead of using try...catch blocks

 
if ( o != null )
{
o.method();
}

NOT:

 
try
{
o.method();
}
catch ( error )
{
trace( error );
}

References:

Sean Christmann: Optimizing Adobe AIR for Code Execution, Memory, and Rendering 
http://www.craftymind.com/2008/11/20/max-2008-session-material/

Dennis Ippel: Some ActionScript 3.0 Optimizations 
http://www.rozengain.com/blog/2007/05/01/some-actionscript-30-optimizations/

Shane McCartney: Tips on how to write efficient AS3 
http://www.lostinactionscript.com/blog/index.php/2008/09/28/tips-on-how-to-write-efficient-as3/

Flex Application Performance: Tips and Techniques for Improving Client Application Performance 
http://www.adobe.com/devnet/flex/articles/client_perf.html

Stephen Calender: ActionScript 3.0 Benchmarking 
http://www.stephencalenderblog.com/?p=7

Grant Skinner: Types in AS3: ints not so fast, uints slow! 
http://www.gskinner.com/blog/archives/2006/06/types_in_as3_in.html

Grant Skinner: Resource management strategies in Flash Player 9 
http://www.adobe.com/devnet/flashplayer/articles/resource_management.html

Gary Grossman: ActionScript 3.0 and AVM2 Performance Tuning 
http://www.onflex.org/ACDS/AS3TuningInsideAVM2JIT.pdf

Fastest way to copy an array 
http://agit8.turbulent.ca/bwp/2008/08/04/flash-as3-optimization-fastest-way-to-copy-an-array/

Andre Michelle: AS3 optimations & suggestions 
http://blog.andre-michelle.com/2005/as3-optimations-suggestions/

Package-level function closures in ActionScript 
http://www.ericfeminella.com/blog/2008/05/06/package-level-function-closures-in-actionscript/

ActionScript 3 optimization techniques 
http://blog.joa-ebert.com/2008/04/26/actionscript-3-optimization-techniques/

AS3 Performance Tester 
http://businessintelligence.me/projects/performance_tester/performanceTester.html

:
Posted by 라면스프



   플래시 object 및 embed 태그 사용시 매개 변수 및 속성 07-12-14 03:34
  작성자 : Dolch     조회 2700    
다음 태그 속성 및 매개 변수는 제작 명령에 의해 만들어진 HTML 코드에 대해 설명합니다. Flash 내용을 보여주는 사용자 정의 HTML을 작성할 때 이 목록을 참조할 수 있습니다. 별도로 지정하지 않는 한 모든 항목은 object 태그와 embed 태그 모두에 적용됩니다. 선택적 항목은 표시되어 있습니다. 매개 변수는 object 태그와 함께 사용되고 Internet Explorer에 의해 인식되는 반면 embed 태그는 Netscape에 의해 인식됩니다. 속성은 object 태그와 embed 태그에서 모두 사용됩니다. 템플릿을 사용자 정의하는 경우 값 대신 템플릿 변수(다음 목록의 각 매개 변수에 대한 값 섹션에 나옴)를 사용할 수 있습니다. 자세한 내용은 HTML 제작 템플릿 사용자 정의을(를) 참조하십시오.

devicefont 속성/매개 변수

값      true | false
         템플릿 변수: $DE
설명  (선택 사항) 필요한 글꼴을 운영 체제에서 제공하는 경우 장치 글꼴 옵션이 선택되지 않은 정적 텍스트 객체를 장치 글꼴을 사용하여 표시할지 여부를 지정합니다.


src 속성 

값       movieName.swf
          템플릿 변수: $MO
설명   로드되는 SWF 파일의 이름을 지정합니다. embed 태그에만 적용됩니다


무비 매개 변수 

값      movieName.swf
         템플릿 변수: $MO
설명   로드되는 SWF 파일의 이름을 지정합니다. object 태그에만 적용됩니다.


classid 속성 

값      clsid:d27cdb6e-ae6d-11cf-96b8-444553540000
설명  브라우저에 대한 ActiveX 컨트롤을 확인합니다. 이 값은 표시된 대로 정확하게 입력해야 합니다. object 태그에만 적용됩니다.


width 속성 

값      n 또는 n%
         템플릿 변수: $WI
설명   브라우저 윈도우에 대한 퍼센트 또는 픽셀 단위로 응용 프로그램의 폭을 지정합니다.


height 속성 

값      n 또는 n%
         템플릿 변수: $HE
설명  브라우저 윈도우에 대한 퍼센트 또는 픽셀 단위로 응용 프로그램의 높이를 지정합니다. 
중요  Flash 응용 프로그램의 크기는 조절할 수 있으므로 종횡비가 유지되는 경우에는 응용 프로그램의 크기가 변해도 품질이 낮아지지 않습니다. 예를 들어, 640 x 480 픽셀, 320 x 240 픽셀, 240 x 180 픽셀은 모두 4:3 종횡비를 사용합니다.


codebase 속성 

값      http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0
설명  Flash Player ActiveX 컨트롤이 아직 설치되지 않은 경우에 브라우저가 이 컨트롤을 자동으로 다운로드할 수 있도록 컨트롤의 위치를 확인합니다. 이 값은 표시된 대로 정확하게 입력해야 합니다. object 태그에만 적용됩니다


pluginspage 속성 

값     http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash 
설명  Flash Player 플러그-인이 아직 설치되지 않은 경우에 사용자가 이 플러그-인을 다운로드할 수 있도록 플러그-인의 위치를 확인합니다. 이 값은 표시된 대로 정확하게 입력해야 합니다. embed  태그에만 적용됩니다.


swliveconnect 속성 

값      true | false
설명  (선택 사항) Flash Player를 처음 로드할 때 브라우저에서 Java를 시작할지 여부를 지정합니다. 이 속성이 생략된 경우 기본값은 false입니다. JavaScript와 Flash를 같은 페이지에서 사용하는 경우에는 Java를 실행하여 fscommand() 함수를 작동시켜야 합니다. 그러나 JavaScript를 브라우저 검색이나 fscommand() 액션과 관련되지 않은 다른 용도로만 사용하는 경우에는 SWLIVECONNECT를 false로 설정하여 Java가 시작되지 않도록 할 수 있습니다. JavaScript를 Flash와 함께 사용하지 않는 경우에는 SWLIVECONNECT 속성을 명시적으로 true로 설정하여 Java를 시작할 수도 있습니다. Java를 시작하면 대개 SWF 파일을 시작하는 데 걸리는 시간이 길어지므로, 이 태그는 필요한 경우에만 true로 설정합니다. embed 태그에만 적용됩니다.
fscommand() 액션을 사용하여 독립 실행형 프로젝터 파일에서 Java를 시작합니다.


play 속성/매개 변수 

값      true | false
         템플릿 변수: $PL
설명  (선택 사항) 응용 프로그램이 웹 브라우저에 로드되는 즉시 재생할지 여부를 지정합니다. Flash 응용 프로그램이 대화형인 경우 사용자는 버튼을 클릭하거나 다른 작업을 수행하여 재생을 시작할 수 있습니다. 이러한 경우에는 play 속성을 false로 설정하여 응용 프로그램이 자동으로 시작되지 않도록 합니다. 이 속성이 생략된 경우 기본값은 true입니다.


loop 속성/매개 변수 

값      true | false
         템플릿 변수: $LO
설명  (선택 사항) Flash 내용을 무한히 반복할 것인지 아니면 마지막 프레임에 도달하면 중지시킬 것인지를 지정합니다. 이 속성이 생략된 경우 기본값은 true입니다.


quality 속성/매개 변수 


값     low | medium | high | autolow | autohigh | best
        템플릿 변수: $QU
설명  (선택 사항) 응용 프로그램이 재생될 때 사용할 앤티앨리어싱 수준을 지정합니다. SWF 파일의 각 프레임을 뷰어 화면에 렌더링하기 전에 앤티앨리어싱을 적용하여 다듬으려면 좀더 빠른 프로세서가 필요하므로, 속도나 모양 중 어느 쪽에 우선 순위를 둘 것인지에 따라 다음 값 중 하나를 선택합니다.
Low - 모양보다 재생 속도에 중점을 두어 앤티앨리어싱을 사용하지 않습니다.
Autolow - 속도를 우선적으로 강조하지만 가능한 경우 모양도 향상시킵니다. 이 경우에는 앤티앨리어싱이 해제된 상태로 재생이 시작됩니다. Flash Player가 프로세서에서 앤티앨리어싱을 처리할 수 있음을 감지하면 앤티앨리어싱이 설정됩니다. 
Autohigh - 재생 속도와 모양을 동등하게 강조하지만 필요한 경우에는 모양보다 재생 속도를 우선적으로 고려합니다. 이 경우에는 앤티앨리어싱이 설정된 상태로 재생이 시작됩니다. 프레임 속도가 지정된 프레임 속도 아래로 떨어지면 앤티앨리어싱이 해제되어 재생 속도가 향상됩니다. 이 설정을 사용하여 Flash의 앤티앨리어싱 명령(보기 > 미리 보기 모드 > 앤티앨리어싱)을 에뮬레이션합니다. 
Medium - 앤티앨리어싱을 일부 적용하지만 비트맵을 다듬지는 않습니다. 이 옵션의 품질은 Low 설정보다는 좋지만 High 설정보다는 나쁩니다. 
High - 재생 속도보다 모양에 중점을 두어 항상 앤티앨리어싱을 적용합니다. SWF 파일에 애니메이션이 포함되어 있지 않으면 비트맵이 다듬어지지만 애니메이션이 포함되어 있으면 비트맵이 다듬어지지 않습니다. 
Best - 최상의 품질로 표시하고 재생 속도는 고려하지 않습니다. 모든 출력이 앤티앨리어싱되며 모든 비트맵이 다듬어집니다.
이 속성이 생략된 경우 quality에 대한 기본값은 high입니다.


bgcolor 속성/매개 변수 

값      #RRGGBB(16진수 RGB 값)
          템플릿 변수: $BG
설명    (선택 사항) 응용 프로그램의 배경색을 지정합니다. 이 속성을 사용하여 Flash SWF 파일에 지정된 배경색 설정을 무시합니다. 이 속성은 HTML 페이지의 배경색에 영향을 주지 않습니다.


scale 속성/매개 변수 

값       showall | noborder | exactfit
          템플릿 변수: $SC
설명   (선택 사항) width 및 height 값이 퍼센트 단위를 사용하는 경우에 브라우저 윈도우 내에서 응용 프로그램이 배치되는 방식을 정의합니다.
Showall(기본값) - 응용 프로그램의 원래 종횡비를 유지하면서 전체 Flash 내용을 지정된 영역에 왜곡되지 않게 표시합니다. 응용 프로그램의 두 면에 테두리가 표시될 수 있습니다.
Noborder - 응용 프로그램의 원래 종횡비를 유지하면서 왜곡 또는 잘림 없이 지정된 영역에 맞도록 Flash 내용의 크기를 조절합니다. 
Exactfit - 원래의 종횡비를 유지하지 않으면서 지정된 영역에 전체 Flash 내용을 표시하므로 왜곡이 생길 수 있습니다.
이 속성이 생략된 경우 기본값은 showall이며, width 및 height 값은 퍼센트 단위를 사용합니다.


align 속성 


값       Default | L | R | T | B 
          템플릿 변수: $HA
설명    object, embed 및 img 태그에 대한 align 값을 지정하며 브라우저 윈도우 내에 Flash SWF 파일의 위치를 지정하는 방식을 결정합니다.
Default - 응용 프로그램을 브라우저 윈도우 중앙에 배치하며 브라우저 윈도우가 응용 프로그램보다 작으면 가장자리를 자릅니다.
L, R, T 및 B - 각각 브라우저 윈도우의 왼쪽, 오른쪽, 위쪽 및 아래쪽 가장자리를 따라 응용 프로그램을 정렬하며 필요한 경우에는 나머지 세 면을 자릅니다. 


salign 매개 변수 

값       L | R | T | B | TL | TR | BL | BR 
          템플릿 변수: $SA
설명    (선택 사항) width 및 height 설정에 의해 정의된 영역 내에서 크기가 조절된 Flash SWF 파일의 배치 위치를 지정합니다. 이러한 조건에 대한 자세한 내용은 scale 속성/매개 변수을(를) 참조하십시오. 
L, R, T 및 B - 각각 브라우저 윈도우의 왼쪽, 오른쪽, 위쪽 또는 아래쪽 가장자리를 따라 응용 프로그램을 정렬하며 필요한 경우에는 나머지 세 면을 자릅니다.
TL 및 TR - 각각 브라우저 윈도우의 왼쪽 위 및 오른쪽 위 모서리에 맞추어 응용 프로그램을 정렬하며 필요한 경우에는 아래쪽 면과 남은 오른쪽/왼쪽 면을 자릅니다.
BL 및 BR - 각각 브라우저 윈도우의 왼쪽 아래 및 오른쪽 아래 모서리에 맞추어 응용 프로그램을 정렬하며 필요한 경우에는 위쪽 면과 남은 오른쪽/왼쪽 면을 자릅니다.
이 속성이 생략된 경우에는 Flash 내용이 브라우저 윈도우의 중앙에 배치됩니다.


base 속성 

값      기본 디렉토리 또는 URL
설명   (선택 사항) Flash SWF 파일의 모든 상대 경로 명령문을 확인하는 데 사용되는 기본 디렉토리 또는 URL을 지정합니다. 이 속성은 SWF 파일이 그 밖의 파일과는 다른 폴더에 있는 경우에 유용합니다.


menu 속성/매개 변수
 

값        true | false
           템플릿 변수: $ME
설명    (선택 사항) 보는 사람이 브라우저에서 응용 프로그램 영역을 마우스 오른쪽 버튼으로 클릭(Windows)하거나 Command 키를 누른 상태에서 클릭(Macintosh)할 때 나타날 메뉴의 유형을 지정합니다.
true - 전체 메뉴가 나타나므로 재생 품질을 높이거나 재생을 제어하기 위한 몇몇 옵션을 사용할 수 있습니다.
false - Macromedia Flash Player 6 옵션과 설정 옵션만 들어 있는 메뉴를 표시합니다.
이 속성이 생략된 경우 기본값은 true입니다.


wmode 속성/매개 변수 

값       Window | Opaque | Transparent
           템플릿 변수: $WM
설명    (선택 사항) Internet Explorer 4.0에서 사용할 수 있는 투명 Flash 내용, 절대 위치 지정 및 레이어 지정 기능을 사용할 수 있습니다. 이 속성/매개 변수는 Flash Player ActiveX 컨트롤이 있는 Windows에서만 동작합니다.
Window - 웹 페이지의 사각형 응용 프로그램 영역 윈도우에서 응용 프로그램을 재생합니다. Window는 Flash 응용 프로그램이 HTML 레이어와 전혀 상호 작용하지 않으며 항상 최상위 항목임을 나타냅니다.
Opaque - 페이지에 있는 모든 요소를 응용 프로그램 뒤로 숨깁니다.
Transparent - HTML 페이지의 배경이 응용 프로그램의 모든 투명 영역을 통과해 표시되도록 하지만 애니메이션 속도가 낮아질 수 있습니다.
Opaque windowless 및 Transparent windowless - 둘 모두 HTML 레이어와 상호 작용하므로 SWF 파일 위의 레이어로 인해 응용 프로그램이 보이지 않게 됩니다. 두 속성의 차이는 Transparent의 경우 SWF 파일 아래의 HTML 레이어가 SWF 파일의 투명한 부분을 통해 보일 수 있도록 투명도를 허용한다는 점입니다.이 속성이 생략된 경우 기본값은 Window입니다. object에만 적용됩니다.


allowscriptaccess 속성/매개 변수 

값     always | never | samedomain
설명  allowscriptaccess를 사용하면 Flash 응용 프로그램에서 이 응용 프로그램을 호스팅하는 HTML 페이지와 통신할 수 있습니다. fscommand() 및 getURL() 작업을 수행하면 JavaScript에서 Flash 응용 프로그램의 권한과 다를 수도 있는 HTML 페이지의 권한을 사용하게 되므로 이 속성이 필요합니다. 이는 도메인간 보안에 중요한 영향을 미칩니다. 
always - 언제든지 스크립팅 작업을 수행할 수 있습니다.
never - 모든 스크립팅 작업을 수행할 수 없습니다.
samedomain - Flash 응용 프로그램이 HTML 페이지와 동일한 도메인에 속한 경우에만 스크립팅 작업을 허용합니다. 
모든 HTML 제작 템플릿에 사용되는 기본값은 samedomain입니다.


SeamlessTabbing 매개 변수 

값      true | false
설명  (선택 사항) seamless tabbing을 수행하도록 ActiveX 컨트롤을 설정할 수 있습니다. 이렇게 하면 사용자가 Flash 응용 프로그램에서 탭 이동을 할 수 있습니다. 이 매개 변수는 Flash Player ActiveX 컨트롤 버전 7 이상을 내장한 Windows에서만 유효합니다. 
true (또는 생략) - ActiveX 컨트롤이 seamless tabbing을 수행합니다. 즉, 사용자가 Flash 응용 프로그램에서 탭을 모두 누른 후에 탭 키를 다시 누르면 Flash 응용 프로그램 범위를 넘어 주변의 HTML 내용으로 포커스가 이동합니다. Flash 응용 프로그램에 이어 HTML에 포커스를 줄 만한 것이 아무 것도 없으면 브라우저의 상태 표시줄로 포커스가 이동합니다.
false - ActiveX 컨트롤이 버전 6 및 그 이전에서처럼 작동합니다. 즉, 사용자가 Flash 응용 프로그램에서 탭을 모두 누른 후에 탭 키를 다시 누르면 Flash 응용 프로그램의 시작 부분으로 포커스가 이동합니다. 이 모드에서는 탭 키를 눌러 Flash 응용 프로그램 이외의 곳으로 포커스를 이동할 수 없습니다.

:
Posted by 라면스프
2010. 2. 8. 00:23

Adobe ID 2010. 2. 8. 00:23

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

2009. 12. 28. 17:43

About the application compiler options Enjoy/FLEX2009. 12. 28. 17:43


플렉스 컴파일 옵션 설명


About the application compiler options

The following table describes the application compiler options:

Option

Description

accessible=true|false

Enables accessibility features when compiling the Flex application or SWC file. The default value is false.

For more information on using the Flex accessibility features, see Creating Accessible Applications in Flex 2 Developer's Guide.

actionscript-file-encoding string

Sets the file encoding for ActionScript files.

For more information, see Setting the file encoding.

advanced

Lists advanced help options when used with the help option, as the following example shows:

mxmlc -help advanced

This is an advanced option.

allow-source-path-overlap=true|false

Checks if a source-path entry is a subdirectory of another source-path entry. It helps make the package names of MXML components unambiguous.

This is an advanced option.

as3=true|false

Use the ActionScript 3.0 class-based object model for greater performance and better error reporting. In the class-based object model, most built-in functions are implemented as fixed methods of classes.

The default value is true. If you set this value to false, you must set the es option to true.

This is an advanced option.

benchmark=true|false

Prints detailed compile times to the standard output. The default value is true.

context-root context-path

Sets the value of the {context.root} token in channel definitions in the flex-services.xml file. If you do not specify the value of this option, Flex uses an empty string.

For more information on using the {context.root} token, see About application files.

contributor name

Sets metadata in the resulting SWF file. For more information, see Adding metadata to SWF files.

creator name

Sets metadata in the resulting SWF file. For more information, see Adding metadata to SWF files.

date text

Sets metadata in the resulting SWF file. For more information, see Adding metadata to SWF files.

debug=true|false

Generates a debug SWF file. This file includes line numbers and filenames of all the source files. When a run-time error occurs, the stacktrace shows these line numbers and filenames. This information is also used by the command-line debugger and the Flex Builder debugger. Enabling the debug option generates larger SWF files.

For the mxmlc compiler, the default value is false. For the compc compiler, the default value is true.

For SWC files generated with the compc compiler, set this value to true, unless the target SWC file is an RSL. In that case, set the debug option to false.

For information about the command-line debugger, see Using the Command-Line Debugger.

Flex also uses the verbose-stacktraces setting to determine whether line numbers are added to the stacktrace.

debug-password string

Lets you engage in remote debugging sessions with the Flash IDE.

This is an advanced option.

default-background-color int

Sets the application's background color. You use the 0x notation to set the color, as the following example shows:

-default-background-color=0xCCCCFF

The default value is null. The default background of a Flex application is an image of a gray gradient. You must override this image for the value of the default-background-color option to be visible. For more information, see Editing application settings.

This is an advanced option.

default-frame-rate int

Sets the application's frame rate. The default value is 24.

This is an advanced option.

default-script-limits 
max-recursion-depth 
max-execution-time

Defines the application's script execution limits.

The max-recursion-depth value specifies the maximum depth of Adobe Flash Player call stack before Flash Player stops. This is essentially the stack overflow limit. The default value is 1000.

The max-execution-time value specifies the maximum duration, in seconds, that an ActionScript event handler can execute before Flash Player assumes that it is hung, and aborts it. The default value is 60 seconds. You cannot set this value above 60 seconds.

You can override these settings in the application.

This is an advanced option.

default-size width height

Defines the default application size, in pixels.

This is an advanced option.

defaults-css-url string

Defines the location of the default style sheet. Setting this option overrides the implicit use of the defaults.css style sheet in the framework.swc file.

For more information on the defaults.css file, see Using Styles and Themes in Flex 2 Developer's Guide.

This is an advanced option.

description text

Sets metadata in the resulting SWF file. For more information, see Adding metadata to SWF files.

dump-config filename

Outputs the compiler options in the flex-config.xml file to the target path; for example:

mxmlc -dump-config myapp-config.xml

This is an advanced option.

es=true|false

Use the ECMAScript edition 3 prototype-based object model to allow dynamic overriding of prototype properties. In the prototype-based object model, built-in functions are implemented as dynamic properties of prototype objects.

You can set the strict option to true when you use this model, but it might result in compiler errors for references to dynamic properties.

The default value is false. If you set this option to true, you must set the es3 option to false.

This is an advanced option.

externs symbol [...]

Sets a list of symbols to exclude from linking when compiling a SWF file.

This option provides compile-time link checking for external references that are dynamically linked.

For more information about dynamic linking, see About linking.

This is an advanced option.

external-library-path path-element [...]

Specifies a list of SWC files or directories to exclude from linking when compiling a SWF file. This option provides compile-time link checking for external components that are dynamically linked.

For more information about dynamic linking, see About linking.

You can use the += operator to append the new SWC file to the list of external libraries.

file-specs path-element [...]

Specifies source files to compile. This is the default option for the mxmlc compiler.

fonts.languages.language-range lang range

Specifies the range of Unicode settings for that language. For more information, see Using Styles and Themes inFlex 2 Developer's Guide.

This is an advanced option.

fonts.managers manager-class [...]

Defines the font manager. The default is flash.fonts.JREFontManager. You can also use the flash.fonts.BatikFontManager. For more information, see Using Styles and Themes in Flex 2 Developer's Guide.

This is an advanced option.

fonts.max-cached-fonts string

Sets the maximum number of fonts to keep in the server cache. For more information, see Caching fonts and glyphs.

This is an advanced option.

fonts.max-glyphs-per-face string

Sets the maximum number of character glyph-outlines to keep in the server cache for each font face. For more information, see Caching fonts and glyphs.

This is an advanced option.

frames.frame label class name [...]

Specifies a SWF file frame label with a sequence of class names that are linked onto the frame.

This is an advanced option.

generate-frame-loader=true|false

Toggles the generation of an IFlexBootstrap-derived loader class.

This is an advanced option.

headless-server=true|false

Enables the headless implementation of the Flex compiler. This sets the following:

System.setProperty("java.awt.headless", "true")

The headless setting (java.awt.headless=true) is required to use fonts and SVG on UNIX systems without X Windows.

This is an advanced option.

help

Prints usage information to the standard output. For more information, see Command-line syntax.

include-libraries library [...]

Links all classes inside a SWC file to the resulting application SWF file, regardless of whether or not they are used.

Contrast this option with the library-path option that includes only those classes that are referenced at compile time.

To link one or more classes whether or not they are used and not an entire SWC file, use the includes option.

This option is commonly used to specify resource bundles.

includes class [...]

Links one or more classes to the resulting application SWF file, whether or not those classes are required at compile time.

To link an entire SWC file rather than individual classes, use the include-libraries option.

incremental=true|false

Enables incremental compilation. For more information, see About incremental compilation.

This option is true by default for the Flex Builder application compiler. For the command-line compiler, the default is false. The web-tier compiler does not support incremental compilation.

keep-generated-actionscript=true|false

Determines whether to keep the generated ActionScript class files.

The generated class files include stubs and classes that are generated by the compiler and used to build the SWF file.

The default location of the files is the /generated subdirectory, which is directly below the target MXML file. If the /generated directory does not exist, the compiler creates one.

The default names of the primary generated class files are filename-generated.as and filename-interface.as.

The default value is false.

This is an advanced option.

language code

Sets metadata in the resulting SWF file. For more information, see Adding metadata to SWF files.

lazy-init=true|false

Enables ABC bytecode lazy initialization.

The default value is false.

This is an advanced option.

library-path path-element [...]

Links SWC files to the resulting application SWF file. The compiler only links in those classes for the SWC file that are required.

The default value of the library-path option includes all SWC files in the libs directory and the current locale. These are required.

To point to individual classes or packages rather than entire SWC files, use the source-path option.

If you set the value of the library-path as an option of the command-line compiler, you must also explicitly add the framework.swc and locale SWC files. Your new entry is not appended to the library-path but replaces it.

You can use the += operator to append the new argument to the list of existing SWC files.

In a configuration file, you can set the append attribute of the library-path tag to true to indicate that the values should be appended to the library path rather than replace it.

link-report filename

Prints linking information to the specified output file. This file is an XML file that contains <def><pre>, and<ext> symbols showing linker dependencies in the final SWF file.

The file format output by this command can be used to write a file for input to the load-externs option.

For more information on the report, see Examining linker dependencies.

This is an advanced option.

load-config filename

Specifies the location of the configuration file that defines compiler options.

If you specify a configuration file, you can override individual options by setting them on the command line.

All relative paths in the configuration file are relative to the location of the configuration file itself.

Use the += operator to chain this configuration file to other configuration files.

For more information on using configuration files to provide options to the command-line compilers, see About configuration files.

load-externs filename [...]

Specifies the location of an XML file that contains <def><pre>, and <ext> symbols to omit from linking when compiling a SWF file. The XML file uses the same syntax as the one produced by the link-report option. For more information on the report, see Examining linker dependencies.

This option provides compile-time link checking for external components that are dynamically linked.

For more information about dynamic linking, see About linking.

This is an advanced option.

locale string

Specifies the locale that should be packaged in the SWF file (for example, en_EN). You run the mxmlc compiler multiple times to create SWF files for more than one locale, with only the locale option changing.

You must also include the parent directory of the individual locale directories, plus the token {locale}, in thesource-path; for example:

mxmlc -locale en_EN -source-path locale/{locale} -file-specs MainApp.mxml

For more information, see Localizing Flex Applicationsin Flex 2 Developer's Guide.

localized-description text lang

Sets metadata in the resulting SWF file. For more information, see Adding metadata to SWF files.

localized-title text lang

Sets metadata in the resulting SWF file. For more information, see Adding metadata to SWF files.

namespaces.namespace uri manifest

Specifies a namespace for the MXML file. You must include a URI and the location of the manifest file that defines the contents of this namespace. This path is relative to the MXML file.

For more information about manifest files, see About manifest files.

optimize=true|false

Enables the ActionScript optimizer. This optimizer reduces file size and increases performance by optimizing the SWF file's bytecode.

The default value is false.

output filename

Specifies the output path and filename for the resulting file. If you omit this option, the compiler saves the SWF file to the directory where the target file is located.

The default SWF filename matches the target filename, but with a SWF file extension.

If you use a relative path to define the filename, it is always relative to the current working directory, not the target MXML application root.

The compiler creates extra directories based on the specified filename if those directories are not present.

When using this option with the component compiler, the output is a SWC file rather than a SWF file.

publisher name

Sets metadata in the resulting SWF file. For more information, see Adding metadata to SWF files.

resource-bundle-list filename

Prints a list of resource bundles to input to the compc compiler to create a resource bundle SWC file. Thefilename argument is the name of the file that contains the list of bundles.

For more information, see Localizing Flex Applications in Flex 2 Developer's Guide.

runtime-shared-libraries url [...]

Specifies a list of run-time shared libraries (RSLs) to use for this application. RSLs are dynamically-linked at run time.

You specify the location of the SWF file relative to the deployment location of the application. For example, if you store a file named library.swf file in the web_root/libraries directory on the web server, and the application in the web root, you specify libraries/library.swf.

For more information about RSLs, see Using Runtime Shared Libraries.

services filename

Specifies the location of the services-config.xml file. This file is used by Flex Data Services.

show-binding-warnings=true|false

Shows a warning when Flash Player cannot detect changes to a bound property.

The default value is true.

For more information about compiler warnings, see Using SWC files.

show-actionscript-warnings=true|false

Shows warnings for ActionScript classes.

The default value is true.

For more information about viewing warnings and errors, see Viewing warnings and errors.

show-deprecation-warnings=true|false

Shows deprecation warnings for Flex components. To see warnings for ActionScript classes, use the show-actionscript-warnings option.

The default value is true.

For more information about viewing warnings and errors, see Viewing warnings and errors.

source-path path-element [...]

Adds directories or files to the source path. The Flex compiler searches directories in the source path for MXML or AS source files that are used in your Flex applications and includes those that are required at compile time.

You can use wildcards to include all files and subdirectories of a directory.

To link an entire library SWC file and not individual classes or directories, use the library-path option.

The source path is also used as the search path for the component compiler's include-classes and include-resource-bundles options.

You can also use the += operator to append the new argument to the list of existing source path entries.

strict=true|false

Prints undefined property and function calls; also performs compile-time type checking on assignments and options supplied to method calls.

The default value is true.

For more information about viewing warnings and errors, see Viewing warnings and errors.

theme filename [...]

Specifies a list of theme files to use with this application. Theme files can be SWC files with CSS files inside them or CSS files.

For information on compiling a SWC theme file, see Using Styles and Themes in Flex 2 Developer's Guide.

title text

Sets metadata in the resulting SWF file. For more information, see Adding metadata to SWF files.

use-network=true|false

Specifies that the current application uses network services.

The default value is true.

When the use-network property is set to false, the application can access the local filesystem (for example, use the XML.load() method with file: URLs) but not network services. In most circumstances, the value of this property should be true.

For more information about the use-network property, see Applying Flex Security.

verbose-stacktraces=true|false

Generates source code that includes line numbers. When a run-time error occurs, the stacktrace shows these line numbers.

Enabling this option generates larger SWF files.

The default value is false.

version

Returns the version number of the MXML compiler. If you are using a trial or Beta version of Flex, the version option also returns the number of days remaining in the trial period and the expiration date.

warn-warning_type=true|false

Enables specified warnings. For more information, see Viewing warnings and errors.

warnings=true|false

Enables all warnings. Set to false to disable all warnings. This option overrides the warn-warning_type options.

The default value is true.

The following sections provide examples of using the mxmlc application compiler options on the command line. You can also use these techniques with the application compilers in the Flex Builder and web-tier environments.

:
Posted by 라면스프