Flex 中 mx.controls.Alert.show("") 如何调用Txetinput中输入的数据?

来源:百度知道 编辑:UC知道 时间:2024/06/17 21:09:52
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.controls.Alert;

private function clicktishixinxiheard(e:MouseEvent):void
{
var a:Number=0;
var b:Number=0;
a=new Number(textinput1.text);
b=new Number(textinput2.text);
mx.controls.Alert.show("");
}
]]>
</mx:Script>
<mx:TextInput id="textinput1" x="160" y="81"/>
<mx:TextInput id="textinput2" x="160" y="145"/>
<mx:Label x="93" y="83" text="信息1" fontSize="12"/>
<mx:Label x="93" y="147" text="信息2" fontSize

Alert.show 第一个参数的意思 在 Alert 控件中显示的文本字符串。

所以,只能显示字符串

var a:String;
var b:String;
a=textinput1.text;
b=textinput2.text;
mx.controls.Alert.show(a + "text1的数据" + b + "text2的数据");

mx.controls.Alert.show (textinput1.text+textinput2.text);