<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
public function showinput():void
{
var myInt:int = parseInt(input.text);
var myFloat:Number = parseFloat(input.text);
var myNumber:Number = new Number(input.text);
// use the toString() method to convert from a number to a string
mx.controls.Alert.show("Integer: " + myInt.toString() +
"; Float: " + myFloat.toString() +
"; Number: " + myNumber.toString());
}
]]>
</mx:Script>
<mx:TextInput id="input" x="10" y="10" width="78"/>
<mx:Button x="96" y="10" label="Show Number" click="showinput();"/>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
public function showinput():void
{
var myInt:int = parseInt(input.text);
var myFloat:Number = parseFloat(input.text);
var myNumber:Number = new Number(input.text);
// use the toString() method to convert from a number to a string
mx.controls.Alert.show("Integer: " + myInt.toString() +
"; Float: " + myFloat.toString() +
"; Number: " + myNumber.toString());
}
]]>
</mx:Script>
<mx:TextInput id="input" x="10" y="10" width="78"/>
<mx:Button x="96" y="10" label="Show Number" click="showinput();"/>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。