도스상에서 플렉스 사용하기

· 17년 전 · 3158
안녕하세요.
플렉스에 관심이 많아서, 현재 프로젝트 진행하면서 삽질중입니다.
이곳에 플렉스란이 있다는 것은 얼마전에 알았는데, 관심을 가지시는 분은 얼마 없는듯..


그냥 알고 있는거 간단히 적어봅니다.
시간되면 자주 적도록 하겠습니다.. ^^;


오늘은 도스상에서 플렉스 사용하기입니다.
플렉스 빌더가 있으면 빌더를 사용하면 되지만, 프로젝트 형태가 아니거나, 간단한 코딩한 것을 결과물을 내려고 할때는
도스상에서 처리하는 것이 편합니다.

빌더가 이클립스 기반이라서 시스템의 리소스를 많이 잡아먹어서, 고사양의 컴터가 아니면..
컴파일 하는데, 시간만 많이 소요되기도 하고요.
(아래부터 존재 생략..)


우선 플렉스 sdk가 있어야 한다.
SDK는 현재 두종류가 있다.
SDK 2.0.1 과 SDK 3 beta3 버전이다.
여기서는 2.0.1을 사용하기로 한다.


http://labs.adobe.com/technologies/flex/sdk/flex2sdk.html
이곳에서 다운을 받으면 된다.


SDK 3은 아래 링크에서 받으면 된다.
http://www.adobe.com/cfusion/entitlement/index.cfm?e=flex3email
하단의 Flex 3.0 SDK에 License부분 체크해 보면 바로 다운로드 할수 있다.
(플렉스를 실행하기 위해서는 jre가 설치되어야 있어야 한다.)


jre가 설치되어 있기 않다면, http://java.sun.com/ 에서 최신 java를 설치하자.
(여기서는 설치과정 생략. 검색하면 많이 나올겁니다.)
자바 버전은 1.5 이상이면 제대로 작동될겁니다.


다운 받았다면, 압축을 풀고 해당 디렉토리의 bin 경로로 가 보자.
bin 디렉토리 밑에 mxmlc.exe 파일이 보일것이다.
이것이 플렉스의 mxml 파일을 컴파일하는 컴파일러이다.


D:\04.Language\__SDK\flex_sdk_2\bin>mxmlc
Adobe Flex Compiler (mxmlc)
Version 2.0.1 build 155542
Copyright (c) 2004-2006 Adobe Systems, Inc. All rights reserved.

mxmlc [options] [defaultVar]
Use 'mxmlc -help' for more information.


옵션을 출력해 보자.

D:\04.Language\__SDK\flex_sdk_2\bin>mxmlc -help list
Adobe Flex Compiler (mxmlc)
Version 2.0.1 build 155542
Copyright (c) 2004-2006 Adobe Systems, Inc. All rights reserved.

-benchmark
-compiler.accessible
-compiler.actionscript-file-encoding <string>
-compiler.context-root <context-path>
-compiler.debug
-compiler.external-library-path [path-element] [...]
-compiler.fonts.flash-type
-compiler.fonts.max-glyphs-per-face <string>
-compiler.include-libraries [library] [...]
-compiler.incremental
-compiler.library-path [path-element] [...]
-compiler.locale <string>
-compiler.namespaces.namespace <uri> <manifest>
-compiler.optimize
-compiler.services <filename>
-compiler.show-actionscript-warnings
-compiler.show-binding-warnings
-compiler.show-deprecation-warnings
-compiler.show-unused-type-selector-warnings
-compiler.source-path [path-element] [...]
-compiler.strict
-compiler.theme [filename] [...]
-compiler.use-resource-bundle-metadata
-help [keyword] [...]
-licenses.license <product> <serial-number>
-load-config <filename>
-metadata.contributor <name>
-metadata.creator <name>
-metadata.date <text>
-metadata.description <text>
-metadata.language <code>
-metadata.localized-description <text> <lang>
-metadata.localized-title <title> <lang>
-metadata.publisher <name>
-metadata.title <text>
-output <filename>
-runtime-shared-libraries [url] [...]
-use-network
-version
-warnings


해당 옵션들중 중요한거 몇가지만 살펴보자.

-debug=true : 디버그 모드로 컴파일여부 지정
-warnings=false : 경고메세지 출력 여부
-source-path : 소스 경로
-load-config : 컴파일에 사용한 flex-config.xml 파일 경로
-compiler.옵션명 : flex-config.xml 파일의 컴파일 관련값 설정

그럼 간단히 코드를 작성해 보도록 하겠습니다..

hello.mxml

<?xml version='1.0' encoding='utf-8'?>
<mx:Application xmlns:mx='http://www.adobe.com/2006/mxml' layout='absolute'>
    <mx:Panel x='57' y='24' width='466' height='331' layout='absolute'>
        <mx:TextInput x='111' y='118' id='txtName'/>
        <mx:Button x='279' y='118' label='button' click="mx.controls.Alert.show('Hello Flex!! '+ txtName.text)"/>
    </mx:Panel>
</mx:Application>

이제 컴파일을 시켜 보자.

D:\04.Language\Flex\TestCode>mxmlc hello.mxml
Loading configuration file C:\Program Files\Adobe\Flex Builder 2\Flex SDK 2\frameworks\flex-config.xml
D:\04.Language\Flex\TestCode\hello.swf (141521 bytes)

정상적으로 컴파일이 되었고, hello.swf파일이 생성이 되었다.
만일 오류코드를 보고 싶다면 위 코드에서 약간 수정하고 컴파일하면 에러 코드 출력이 어떻게 되는지 볼수 있을 것이다.

이제 결과물을 실행해 보자.

D:\04.Language\Flex\TestCode>hello.swf

이처럼 했는데, swf가 실행이 되지 않다는다면 아래 링크에서 플래시 플레이어를 설치하자.

http://www.adobe.com/support/flashplayer/downloads.html
플렉스를 하고자 한다면 개발자용 debug player가 유용하니, debug용으로 받아서 설치하고..
다시 도스상에서 실행하면 결과물을 볼수 있을 것이다.

오늘은 요까지입니다.
잘못된 것이 있다면 알려주세요.
그럼 다들 수고하세요.
[이 게시물은 관리자님에 의해 2011-10-31 16:50:06 Flash에서 이동 됨]
|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

태그 필터 (최대 3개) 전체 개발자 소스 기타 mysql 팁자료실 javascript php linux flash 정규표현식 jquery node.js mobile 웹서버 os 프로그램 강좌 썸네일 이미지관련 도로명주소 그누보드5 기획자 견적서 계약서 기획서 마케팅 제안서 seo 통계 서식 통계자료 퍼블리셔 html css 반응형 웹접근성 퍼블리싱 표준화 반응형웹 홈페이지기초 부트스트랩 angularjs 포럼 스크린리더 센스리더 개발자톡 개발자팁 퍼블리셔톡 퍼블리셔팁 기획자톡 기획자팁 프로그램강좌 퍼블리싱강좌
+
제목 글쓴이 날짜 조회
17년 전 조회 1,598
17년 전 조회 2,365
17년 전 조회 1,785
17년 전 조회 1,498
17년 전 조회 1,350
17년 전 조회 2,019
17년 전 조회 2,918
17년 전 조회 2,535
17년 전 조회 1,555
17년 전 조회 2,905
17년 전 조회 2,439
17년 전 조회 2,788
17년 전 조회 2,803
17년 전 조회 2,576
17년 전 조회 2,397
17년 전 조회 1,750
17년 전 조회 2,487
17년 전 조회 3,980
17년 전 조회 1,853
17년 전 조회 3,951
17년 전 조회 1,873
17년 전 조회 1,769
17년 전 조회 2,100
17년 전 조회 2,504
17년 전 조회 1,467
17년 전 조회 1,801
17년 전 조회 2,374
17년 전 조회 1,844
17년 전 조회 1,781
17년 전 조회 1,575
17년 전 조회 1,418
17년 전 조회 1,378
17년 전 조회 1,183
17년 전 조회 1,178
17년 전 조회 1,199
17년 전 조회 1,211
17년 전 조회 1,627
17년 전 조회 1,709
17년 전 조회 1,851
17년 전 조회 2,980
17년 전 조회 2,129
17년 전 조회 1,800
17년 전 조회 2,137
17년 전 조회 1,850
17년 전 조회 3,387
17년 전 조회 1,563
17년 전 조회 1,687
17년 전 조회 1,406
17년 전 조회 2,217
17년 전 조회 3,159
17년 전 조회 2,304
17년 전 조회 1,759
17년 전 조회 3,021
17년 전 조회 4,464
17년 전 조회 1,778
17년 전 조회 3,271
17년 전 조회 1,597
17년 전 조회 3,510
17년 전 조회 5,866
17년 전 조회 1,447
17년 전 조회 2,191
17년 전 조회 1,810
17년 전 조회 1,561
17년 전 조회 2,445
17년 전 조회 2,655
17년 전 조회 1,620
18년 전 조회 2,710
18년 전 조회 3,195
18년 전 조회 1,553
18년 전 조회 1,973
18년 전 조회 3,873
18년 전 조회 4,506
18년 전 조회 1,898
18년 전 조회 1,762
18년 전 조회 2,699
18년 전 조회 1,874
18년 전 조회 3,958
18년 전 조회 1,673
16년 전 조회 1,959
18년 전 조회 2,284
18년 전 조회 2,138
18년 전 조회 3,595
18년 전 조회 1,611
18년 전 조회 2,676
18년 전 조회 1,669
18년 전 조회 1,938
18년 전 조회 7,454
18년 전 조회 2,025
18년 전 조회 4,114
18년 전 조회 2,446
18년 전 조회 2,455
18년 전 조회 2,176
18년 전 조회 2,218
18년 전 조회 2,641
18년 전 조회 3,239
18년 전 조회 5,349
18년 전 조회 2,811
18년 전 조회 2,722
18년 전 조회 2,572
18년 전 조회 1,822