专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > Flex

flex札记1,外部调研类

发布时间:2011-06-27 19:46:30 文章来源:www.iduyao.cn 采编人员:星星草
flex笔记1,外部调研类
外部调研类
package com.jspx.flex
{
	import mx.controls.Alert;
	import mx.events.FlexEvent;

	public class TestAlert
	{
		public function showAlert():void
		{
			Alert.show("测试外部研类");
		}
	}
}



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 com.jspx.flex.TestAlert;		
			protected function alertInfo():void
			{
				var ta:TestAlert = new TestAlert();
				ta.showAlert();
				
			}
		]]>
	</fx:Script>
	<s:Label x="36" y="36" text="XYZ Corporation Directory" color="maroon" fontSize="20" fontWeight="bold"/>
	<s:Button x="36" y="85" label="对话框" id="empBtn" click="alertInfo()"/>
	<s:Button x="223" y="86" label="测试2" id="deptBtn"/>
	<mx:DataGrid x="36" y="114" id="empDg" width="500" editable="true">
		<mx:columns>
			<mx:DataGridColumn headerText="第一行" dataField="col1"/>
			<mx:DataGridColumn headerText="第二行" dataField="col2"/>
			<mx:DataGridColumn headerText="第三行" dataField="col3"/>
		</mx:columns>
	</mx:DataGrid>   
</s:Application>


事件可以如同javascript一样调研,类的载入和java比较类似,
函数表示方式为:public function showAlert():void
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: