<?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 />

</mx:Application>

相关文章:

  • 2021-10-13
  • 2021-06-20
  • 2021-12-31
  • 2021-10-06
  • 2022-12-23
  • 2021-06-09
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-25
  • 2022-01-15
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案