flex组件学习

我用办法是:用可视化编辑。然后看效果理解意思

<mx:Script>
		<![CDATA[
			import mx.controls.HorizontalList;
			
//			private var _horizontallist:Array=new Array(){"kang,yong,fan"};
			
		]]>
	</mx:Script>
	<mx:ApplicationControlBar x="62" y="42" width="150" height="94" dock="true" id="Application" fontFamily="Verdana" fontSize="16" alpha="0.54" themeColor="#2B87C2">
		<mx:ControlBar id="controlBar" fontFamily="Courier New" width="216" height="71">
		</mx:ControlBar>
	</mx:ApplicationControlBar>
	<mx:ControlBar x="85" y="106">
	</mx:ControlBar>
	<!--dateChooser是个日期选择器 出现个框让你选择-->
	<mx:DateChooser x="22" y="10" height="198" width="212"/>
	<!--dateField是个日期选择,只在点击的时候出现选择对话框,跟DateChooser由点区别-->
	<mx:DateField y="57" width="95" id="_dateField" displayedMonth="11" 
		displayedYear="2009" showToday="true" x="264"/>
	<!--滑动条-->
	<mx:HSlider x="264" y="10" id="_Hslider" minimum="10" maximum="50" snapInterval="1" enabled="true" allowTrackClick="true"/>
	<!--多选框按钮-->
	<mx:CheckBox x="264" y="106" label="Checkbox" id="_checkBox" selected="true" click=""/>
	<!--颜色选择器-->
	<mx:ColorPicker x="264" y="151" width="95"/>
	<!--水平list-->
	<mx:HorizontalList x="432" y="20" width="192" height="108">
		 <mx:dataProvider>
                <mx:Array>
                    <mx:Object label="Nokia 6630"/>
                    <mx:Object label="Nokia 6680"/>
                    <mx:Object label="Nokia 7610"/>
                    <mx:Object label="Nokia LGV"/>
                    <mx:Object label="Nokia LMV"/>
                </mx:Array>
            </mx:dataProvider>
	</mx:HorizontalList>
	<!--加载图片-->
	<mx:Image x="483" y="136" width="141" source="assert/girl.png" height="231" autoLoad="true" scaleContent="true" id="_image"/>
	<!--label-->
	<mx:Label x="385" y="155" text="Label" width="39"/>
	<!--一个链接button?效果上跟label一样,没有跟button一样的方框-->
	<mx:LinkButton x="22" y="236" label="LinkButton" height="30"/>
	<!--下拉列表式list-->
	<mx:List x="139" y="236" id="_list" selectedIndex="2">
		<mx:dataProvider>
				 <mx:Array id="array">
                    <mx:Object label="Nokia 6630"/>
                    <mx:Object label="Nokia 6680"/>
                    <mx:Object label="Nokia 7610"/>
                    <mx:Object label="Nokia LGV"/>
                    <mx:Object label="Nokia LMV"/>
                </mx:Array>
		</mx:dataProvider>
	</mx:List>
	<!--一个上下箭头按钮增加数字-->
	<mx:NumericStepper x="264" y="237"/>
	<!--支持多级菜单-->
	<mx:PopUpButton x="347" y="237" label="PopUpButton" labelPlacement="top" id="_popupButton" 
		openAlways="true" creationComplete="initMenu(_popupButton)">
		
	</mx:PopUpButton>
	<mx:Script>
		<![CDATA[
			import mx.core.UIComponent;
			  import mx.controls.Menu;
			  import mx.controls.Button;
			 
			  private var myMenu:Menu;
			   [Bindable]
			  private var dp:Object;
			  private function initMenu(_popupButton:PopUpButton):void {
                myMenu = new Menu();
                dp = [{label: "New Folder"}, {label: "Sent Items"}, {label: "Inbox"}];        
                myMenu.dataProvider = dp;
                myMenu.selectedIndex = 0;       
                _popupButton.popUp=myMenu;
			  }
		]]>
	</mx:Script>
	<!--只支持单级菜单-->
	<mx:PopUpMenuButton x="347" y="284" 
		label="PopUpMenuButton" id="_popUpMenuButton" 
		 labelPlacement="left" openAlways="true" dataProvider="{dp}"/>
	<!--进度条 加载数据时-->
	<mx:ProgressBar x="262" y="353" minimum="0" maximum="100" labelPlacement="left" label="加载中" id="_ProgressBar" indeterminate="true"/>
	<!--radio-->
	<mx:RadioButton x="22" y="284" label="Radio"/>
	<!--radio组-->
	<mx:RadioButtonGroup id="radiogroup1"/>
	<mx:RadioButton x="22" y="329" label="Button 1" groupName="radiogroup1"/>
	<mx:RadioButton x="22" y="355" label="Button 2" groupName="radiogroup1"/>
	<mx:RadioButton x="22" y="381" label="b1" groupName="radiogroup1"/>
	<mx:RadioButton x="22" y="407" label="b2" groupName="radiogroup1"/>
	<!--多功能的文本输入框,包括字体选择,颜色等-->
	<mx:RichTextEditor x="22" y="437" title="文本输入框" text="hello" id="_RichTextEditor">
	</mx:RichTextEditor>
	<!--把另个swf文件加载进来-->
	<mx:SWFLoader x="361" y="409" id="_swfLoader" scaleContent="true" autoLoad="true">
		<mx:source>file:///E|/myeclipseProject/testBind/bin-debug/testBind.swf</mx:source>
	</mx:SWFLoader>
	<!--text-->
	<mx:Text x="632" y="422" text="Text" width="78" height="71" enabled="true" id="_text"/>
	<!--多行文本输入框  wordWrap(自动换行 )-->
	<mx:TextArea x="385" y="540" wordWrap="false" editable="true" text="hello" id="_textArea" maxChars="200"/>
	<!--单行文本框 可以是password -->
	<mx:TextInput x="574" y="539" text="hello" id="_textInput" displayAsPassword="true" maxChars="3" />
	<!--垂直滑动条 Hslider是水平滑动条-->
	<mx:VSlider x="657" y="136" id="_vskuder" allowTrackClick="true" minimum="10" maximum="50" liveDragging="true"/>
	<!--视频播放-->
	<mx:VideoDisplay x="667" y="336" autoPlay="true" id="_videoDisplay" width="198" height="141">
		<mx:source>file:///E|/flex视频源代码/PPT_示例代码_其他资料/PPT_示例代码_其他资料/示例代码/OtherCtrlDemo/bin-debug/phone.flv</mx:source>
	</mx:VideoDisplay>
	

 

你可能感兴趣的:(Flex,Nokia)