플래시 웹앱 개발

플래시 웹앱 개발
플래시 웹앱 Hello World

1 사전 작업[ | ]

  • 플래시 빌더 4.6 설치

2 새 프로젝트[ | ]

  • File --- New --- Flex Project
  • "New Flex Project" --- Project name: 프로젝트명(예: HelloWeb) --- (O) Web (runs in Adobe Flash Player) --- (O) Use default SDK (currently "Flex 4.6.0") --- [Finish]

그러면 HelloWeb.mxml 이 자동으로 생성되어 있으며 내용은 다음과 같다.

<?xml version="1.0" encoding="utf-8"?>
<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" minWidth="955" minHeight="600">
	<fx:Declarations>
		<!-- Place non-visual elements (e.g., services, value objects) here -->
	</fx:Declarations>
</s:Application>

3 HelloWeb.mxml 수정[ | ]

HelloWeb.mxml의 내용을 다음으로 교체

<?xml version="1.0" encoding="utf-8"?>
<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" minWidth="955" minHeight="600"
			   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:Application>

4 테스트[ | ]

  • Ctrl+F11 눌러 실행

5 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}