플렉스 공부하면서 만들어봤습니다.
설정 정보를 변경하면 상단 영역에 설정한 정보가 반영이 되어 나타나지게 됩니다.
속성 정보도 많고 배우기는 쉬우나 제대로 활용하기는 어려운거 같습니다. 더욱 열심히 해야 겠습니다.
접기
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml " layout="absolute"
backgroundGradientColors="[#FFFFFF,#FFFFFF]"
creationComplete="noticeStart()">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.effects.easing.Linear;
import mx.containers.Form;
/**
* 공지사항
**/
private function noticeStart():void{
moveEff.target = noticeText;
moveEff.xFrom = newsBox.width;
moveEff.xTo = -noticeText.width;
moveEff.repeatCount = 0;
var speed:int = noticeSpeed.value as int;
moveEff.duration = speed * 1000;
moveEff.play();
}
/**
* 공지사항 이벤트
**/
private function chanageNoticeSpeed(event:Event):void{
var speed:int = event.target.value as int;
var result:Number = speed * 1000;
moveEff.duration = result
moveEff.end();
moveEff.play();
}
private function chanageNoticeFontSize(e:Event):void{
moveEff.stop();
moveEff.play();
}
]]>
</mx:Script>
<mx:Style>
Application {
font-family : 'Gulim';
font-size : 12;
}
FormItem {
font-weight : bold;
label-width : 80;
label-align: center;
}
ComboBox {
font-weight : normal;
font-family : 'Gulim';
font-size : 11;
drop-shadow-enabled: true;
copy-cursor: 0;
}
</mx:Style>
<mx:Canvas left="10" right="10" top="10" bottom="10" width="600">
<mx:VBox width="100%" height="100%" horizontalAlign="center" verticalScrollPolicy="off">
<mx:HBox id="newsBox" width="100%"
height="70" backgroundColor="{noticeBackColor.selectedColor}"
verticalAlign="middle" horizontalAlign="off">
<mx:Label id="noticeText"
fontSize="{noticeFontSize.selectedItem.data}"
text="설정사항이 적용되어 표시 됩니다.."
color="{noticeFontColor.selectedColor}"
fontWeight="bold"
fontFamily="{noticeFontFamily.selectedItem.data}"
textAlign="center"/>
</mx:HBox>
<mx:Form left="10" right="10" top="10" bottom="10">
<mx:HRule width="100%" strokeWidth="1"/>
<mx:FormItem label="이동속도" height="22">
<mx:HSlider id="noticeSpeed"
snapInterval="1"
minimum="1"
maximum="30"
value="15"
width="300"
change="chanageNoticeSpeed(event)" />
</mx:FormItem>
<mx:HRule width="100%" strokeWidth="1"/>
<mx:FormItem label="글꼴" height="22">
<mx:ComboBox id="noticeFontFamily" height="20">
<mx:dataProvider>
<mx:ArrayCollection>
<mx:Object label="돋음" data="돋음" />
<mx:Object label="고딕" data="고딕" />
<mx:Object label="굴림" data="Gulim" />
<mx:Object label="궁서" data="궁서" />
</mx:ArrayCollection>
</mx:dataProvider>
</mx:ComboBox>
</mx:FormItem>
<mx:HRule width="100%" strokeWidth="1"/>
<mx:FormItem label="글자크기" height="22">
<mx:ComboBox id="noticeFontSize" selectedIndex="10" change="chanageNoticeFontSize(event)" height="20">
<mx:dataProvider>
<mx:ArrayCollection>
<mx:Object label="8" data="8" />
<mx:Object label="9" data="9" />
<mx:Object label="10" data="10" />
<mx:Object label="12" data="12" />
<mx:Object label="14" data="14" />
<mx:Object label="18" data="18" />
<mx:Object label="20" data="20" />
<mx:Object label="22" data="22" />
<mx:Object label="24" data="24" />
<mx:Object label="26" data="26" />
<mx:Object label="28" data="28" />
<mx:Object label="32" data="32" />
<mx:Object label="36" data="36" />
</mx:ArrayCollection>
</mx:dataProvider>
</mx:ComboBox>
</mx:FormItem>
<mx:HRule width="100%" strokeWidth="1"/>
<mx:FormItem label="글꼴색" height="22">
<mx:ColorPicker id="noticeFontColor" selectedColor="#FFFFFF"/>
</mx:FormItem>
<mx:HRule width="100%" strokeWidth="1"/>
<mx:FormItem label="바탕색" height="22">
<mx:ColorPicker id="noticeBackColor" selectedColor="#000000"/>
</mx:FormItem>
<mx:HRule width="100%" strokeWidth="1"/>
</mx:Form>
<mx:HBox horizontalAlign="right">
<mx:Button label="저장" height="20" fontWeight="normal" fontSize="12"/>
</mx:HBox>
</mx:VBox>
</mx:Canvas>
<mx:Move id="moveEff" easingFunction="{Linear.easeNone}" />
</mx:Application>
접기