플래시 AIR 앱 Hello World

플래시 AIR 앱 개발 시작하기
플래시 데스크탑 앱 개발
플래시 빌더 Hello World
플래시 앱 개발

1 사전 작업[ | ]

  • 플래시 빌더 4.6 설치

2 새 프로젝트[ | ]

  • 플래시 빌더 시작
  • File --- New --- Flex Project
  • Project name: HelloApp
  • Application type: (O) Desktop (runs in Adobe AIR)
  • [Finish][1]

여기까지 하면 HelloApp.mxml 소스코드가 아래와 같이 자동 생성된다.

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
					   xmlns:s="library://ns.adobe.com/flex/spark" 
					   xmlns:mx="library://ns.adobe.com/flex/mx">
	<fx:Declarations>
		<!-- Place non-visual elements (e.g., services, value objects) here -->
	</fx:Declarations>
</s:WindowedApplication>

3 HelloApp.xml 수정[ | ]

다음 내용으로 교체

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
					   xmlns:s="library://ns.adobe.com/flex/spark"
					   xmlns:mx="library://ns.adobe.com/flex/mx"
					   currentState="InitialState" creationComplete="init()">
	<s:states>
		<s:State name="InitialState"/>
		<s:State name="HelloState"/>
	</s:states>
	<fx:Script>
		<![CDATA[
			private function doTest():void {
				currentState = "HelloState";
			}
			private function doInit():void {
				currentState = "InitialState";
			}
		]]>
	</fx:Script>
	<s:Button includeIn="InitialState" x="10" y="10" label="테스트" click="doTest()"/>
	<s:Button includeIn="HelloState" x="10" y="40" label="초기화" click="doInit()"/>
	<s:Label includeIn="HelloState" x="10" y="10" text="안녕, 친구들!"/>
</s:WindowedApplication>

4 테스트[ | ]

  • Ctrl+F11 눌러 실행

5 같이 보기[ | ]

6 주석[ | ]

  1. (기본값) Flex SDK verison: Use defualt SDK
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}