flex 的弹出窗口 addchild
只能用addelement,但是addelement要自己布局,<s:TitleWindow>里<?xmlversion="1.0"encoding="utf-8"?><...
只能用 addelement,但是addelement要自己布局,<s: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" minWidth="348" minHeight="218">
<s:layout>
<s:BasicLayout/>
</s:layout>
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
</fx:Declarations>
<fx:Metadata>
[Event(name="SaveNote")]
</fx:Metadata>
<fx:Script>
<![CDATA[
import mx.managers.PopUpManager;
import mx.controls.*;
public var rowNum:int;
public var check:Boolean;
private function close():void
{
PopUpManager.removePopUp(this);
}
private function save():void
{
this.dispatchEvent(new Event("SaveNote"));
}
public function c():void
{
var tx:TextInput=new TextInput();
tx.id="mm";
tx.width=100;
addChild(tx);
tx.addEventListener(Event.CHANGE,s);
}
public function s(event:Event):void
{
Alert.show("控件的id"+(event.target as TextInput).id+"控件的文本"+(event.target as TextInput).text);
}
]]>
</fx:Script>
<mx:Label text="Author" x="35" y="10"/>
<mx:TextInput id="author" width="150" x="84" y="8"/>
<mx:Label text="Topic" y="36" x="42"/>
<mx:TextInput id="topic" width="150" x="84" y="34"/>
<mx:Label text="Description" y="62" x="10"/>
<mx:TextArea id="description" width="234" height="77" x="84" y="61"/>
<mx:Button label="Cancel" click="close()" x="193" y="146"/>
<mx:Button label="Save" click="save()" x="264" y="146"/>
<mx:Button x="0" y="231" label="点击动态添加控件以及控件发生改变调用" click="c()" width="433" height="46" fontSize="21"/>
</s: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" minWidth="348" minHeight="218">
<s:layout>
<s:BasicLayout/>
</s:layout>
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
</fx:Declarations>
<fx:Metadata>
[Event(name="SaveNote")]
</fx:Metadata>
<fx:Script>
<![CDATA[
import mx.managers.PopUpManager;
import mx.controls.*;
public var rowNum:int;
public var check:Boolean;
private function close():void
{
PopUpManager.removePopUp(this);
}
private function save():void
{
this.dispatchEvent(new Event("SaveNote"));
}
public function c():void
{
var tx:TextInput=new TextInput();
tx.id="mm";
tx.width=100;
addChild(tx);
tx.addEventListener(Event.CHANGE,s);
}
public function s(event:Event):void
{
Alert.show("控件的id"+(event.target as TextInput).id+"控件的文本"+(event.target as TextInput).text);
}
]]>
</fx:Script>
<mx:Label text="Author" x="35" y="10"/>
<mx:TextInput id="author" width="150" x="84" y="8"/>
<mx:Label text="Topic" y="36" x="42"/>
<mx:TextInput id="topic" width="150" x="84" y="34"/>
<mx:Label text="Description" y="62" x="10"/>
<mx:TextArea id="description" width="234" height="77" x="84" y="61"/>
<mx:Button label="Cancel" click="close()" x="193" y="146"/>
<mx:Button label="Save" click="save()" x="264" y="146"/>
<mx:Button x="0" y="231" label="点击动态添加控件以及控件发生改变调用" click="c()" width="433" height="46" fontSize="21"/>
</s:TitleWindow> 展开
2010-07-22
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询