임베디드 FLEX
글 수 19
2008.10.17 14:49:44 (*.105.125.81)
94190
Image 컴포넌트를 어플리케이션 초기화 루틴에서 생성하여 HBox 레이아웃 콘테이너에 추가 한다. 이미지 파일은 image/ 디렉토리에 존재한다.
소스 및 폼
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
creationComplete="CreateApp()">
<mx:Script>
<![CDATA[
import mx.controls.Image;
private function CreateApp():void {
var imgItem : Image;
imgItem = new Image();
imgItem.source = "image/black.PNG";
vbBox.addChild(imgItem);
imgItem = new Image();
imgItem.source = "image/blue.PNG";
vbBox.addChild(imgItem);
imgItem = new Image();
imgItem.source = "image/green.PNG";
vbBox.addChild(imgItem);
imgItem = new Image();
imgItem.source = "image/red.PNG";
vbBox.addChild(imgItem);
imgItem = new Image();
imgItem.source = "image/white.PNG";
vbBox.addChild(imgItem);
}
]]>
</mx:Script>
<mx:HBox id="vbBox" x="10" y="37" width="365" height="170">
</mx:HBox>
</mx:Application>
예제 실행




