<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
// 相加函数
internal function Add():void
{
var iAnum:int = parseInt(A.text);
var iBnum:int = parseInt(B.text);
var iResult:int = iAnum+iBnum;
RESULT.text=String(iResult);
}
]]>
</mx:Script>
<mx:TextArea x="209" y="82" id="A"/>
<mx:TextArea x="209" y="186" id="B"/>
<mx:Button x="209" y="289" label="相加" width="160" click="Add()"/>
<mx:TextArea x="441" y="267" id="RESULT"/>
</mx:Application>
用于计算两个数的和。效果图如下
标签:flex,iResult,int,text,iAnum,parseInt,计算器,var From: https://blog.51cto.com/u_15990596/6101119