リストのテスト

by awef
♥0 | Line 20 | Modified 2009-03-03 20:47:19 | MIT License
play

ActionScript3 source code

/**
 * Copyright awef ( http://wonderfl.net/user/awef )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/A8d8
 */

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
	<mx:ArrayCollection id="lstdat">
	</mx:ArrayCollection>
	
	<mx:Script>
		<![CDATA[
			private function add():void
			{
				lstdat.addItem({label:input.text, data:input.text});
			}
		]]>
	</mx:Script>
	
	<mx:Panel width="250" height="400" title="リスト">
		<mx:List id="lst" width="100%" height="100%" dataProvider="{lstdat}" />
		<mx:ControlBar>
			<mx:TextInput id="input" /> 
			<mx:Button label="Add" click="add()" />
		</mx:ControlBar>
	</mx:Panel>
</mx:Application>