<?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"
width="821" height="232"
initialize="windowedapplication1_initializeHandler(event)"
>
<fx:Script>
<![CDATA[
import mx.collections.ArrayList;
import mx.events.FlexEvent;
import spark.events.IndexChangeEvent;
[Bindable]
private var ac:ArrayList;
protected function windowedapplication1_initializeHandler(event:FlexEvent):void{
ac = new ArrayList([
{label:"applicationStorageDirectory", value:File.applicationStorageDirectory}
, {label:"applicationDirectory", value:File.applicationDirectory}
, {label:"desktopDirectory", value:File.desktopDirectory}
, {label:"documentsDirectory", value:File.documentsDirectory}
, {label:"userDirectory", value:File.userDirectory}
]);
this.cbFile.addEventListener(IndexChangeEvent.CHANGE, combobox1_changeHandler);
this.cbFile.dataProvider = ac;
this.cbFile.selectedIndex = 0;
this.cbFile.dispatchEvent(new IndexChangeEvent(IndexChangeEvent.CHANGE));
}
protected function combobox1_changeHandler(event:IndexChangeEvent):void{
this.lbNativePath.text = File(cbFile.selectedItem.value).nativePath;
}
]]>
</fx:Script>
<s:ComboBox id="cbFile" x="9" y="22" width="199"/>
<s:Label id="lbNativePath" x="215" y="21" width="599" height="24" fontSize="13"
verticalAlign="middle"/>
</s:WindowedApplication>
'Flex / AIR / AS' 카테고리의 다른 글
[AS3.0] Flex Unit 사용하기(1) (0) | 2011.08.26 |
---|---|
[AS3.0] 객체 생성 Singleton 패턴과 mx.core.Singleton (0) | 2011.08.22 |
[Flex 4.5] Spark Group Container (0) | 2011.08.21 |
[Flex Air] 프로그램 종료시 Alert을 이용하여 확인하기 (0) | 2011.08.21 |
[공통] File Templates 설정하기. (0) | 2011.08.14 |