flex 의 버튼, ButtonBar, LinkButton, LinkBar, ToggleButtonBar

1982 단어 flex 단추
<?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>
		<!--       (    、   )     -->
	</fx:Declarations>
	<fx:Script>
		<![CDATA[
			import mx.collections.ArrayCollection;
			import mx.controls.Alert;
			public var myArray:ArrayCollection = new ArrayCollection(['One','Two','Three']);
			public function showMsg(msg:String):void
			{
			Alert.show('you just click on ' + msg);
			}
		]]>
	</fx:Script>
	
	<s:Panel title="Profile" width="360" height="240" horizontalCenter="0" verticalCenter="0">
		<s:layout>
			<s:HorizontalLayout/>
		</s:layout>
		<s:VGroup>
			<s:Button id="thisBtn" label="Button" click="showMsg('button')"/>
			<mx:LinkButton id="thisLinkBtn" label="Linkbutton" click="showMsg('linkbutton')"/>
		</s:VGroup>
		
		<s:VGroup>
			<s:ButtonBar id="thisBtnBar" dataProvider="{myArray}"
						 click="showMsg(ButtonBar(event.currentTarget).selectedItem)"
						 />
			<mx:LinkBar id="thisLinkBar"
						dataProvider="{myArray}"
						itemClick="showMsg(event.label)"/>
			<mx:ToggleButtonBar id="thisToggleBar"
								dataProvider="{myArray}"
								itemClick="showMsg(event.label)"/>
		</s:VGroup>
	</s:Panel>
</s:Application>

좋은 웹페이지 즐겨찾기