flex4 titlewindow接收从父类页面传过来的值

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:Script>
		<![CDATA[
			import com.model.titleWindow;
			
			import mx.collections.ArrayCollection;
			import mx.core.FlexGlobals;
			import mx.managers.PopUpManager;
			
			public  var titleWindows:titleWindow  ;
			protected function button1_clickHandler(event:MouseEvent):void
			{
				/* if(titleWindows.visible){
					PopUpManager.removePopUp(titleWindows);
				} */
				var doctypes:ArrayCollection=new ArrayCollection(["*.as","*.mxml","*.swc"]);
				titleWindows = titleWindow(PopUpManager.createPopUp(this,titleWindow,true));
				
				/* titleWindows.addEventListener("close", removeMe); */
				/* titleWindows["cancelButton"].addEventListener("click", removeMe);   */ 
				/* titleWindows["okButton"].addEventListener("click", submitData);    */
				
				/* titleWindows.owner = this;	
				PopUpManager.addPopUp(titleWindows,this,true);
				PopUpManager.centerPopUp(titleWindows); */
				titleWindows.myArray=doctypes;
				/* 
				var test:titleWindow  =  titleWindow(PopUpManager.createPopUp(this,titleWindow,true,null)); */
				titleWindows.x=FlexGlobals.topLevelApplication.stage.stageWidth/2-titleWindows.width/2;  
				titleWindows.y=FlexGlobals.topLevelApplication.stage.stageHeight/2-titleWindows.height/2; 
			}
			/* private function submitData(event:Event):void {
				ti1.text = String(titleWindows.cb1.selectedItem);
				//removeMe();
				PopUpManager.removePopUp(titleWindows);
			} */
			
			// Cancel button click event listener.
			private function removeMe(event:Event):void {
				PopUpManager.removePopUp(titleWindows);
			}           
		]]>
	</fx:Script>
	
	<s:Button x="243" y="223" label="点击弹出" click="button1_clickHandler(event)"/>
	<s:TextInput x="219" y="80" id="user"/>
	<s:TextInput x="219" y="137" id="pass"/>
	<s:TextInput x="488" y="163" id="ti1"/>
</s:Application>  	
titlewindow模块:
 
<?xml version="1.0" encoding="utf-8"?>
<s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009" 
			   xmlns:s="library://ns.adobe.com/flex/spark" 
			   xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300"
			   close="titlewindow1_closeHandler(event)">
	<fx:Script>
		<![CDATA[
			import mx.collections.ArrayCollection;
			import mx.events.CloseEvent;
			import mx.events.FlexEvent;
			import mx.managers.PopUpManager;
			
			protected function titlewindow1_closeHandler(event:CloseEvent):void
			{
				// TODO Auto-generated method stub
				PopUpManager.removePopUp(this);   
			}
			
			protected function tw_click():void
			{
				var test:taecsMouble  = this.owner as taecsMouble ;
				test.user.text = this.user.text;
				test.pass.text =  this.pass.text;
			}
			
			[Bindable]
			public var myArray:ArrayCollection;
		]]>
	</fx:Script>
	<fx:Declarations>
		<!-- 将非可视元素(例如服务、值对象)放在此处 -->
	</fx:Declarations>
	<s:TextInput x="146" y="94" id="user"/>
	<s:TextInput x="151" y="139" id="pass"/>
	<s:Button x="209" y="199" label="按钮" click="tw_click()"/>
	<s:DropDownList x="62" y="186" dataProvider="{myArray}"></s:DropDownList>
</s:TitleWindow>
   
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值