2 Replies Latest reply on Aug 3, 2009 12:48 AM by ShardulSingh

    Usage of operator "-" in flex.

    sunita_b

      Hi i am new to flex and would like to know the correct syntax for using the operator "-". As when i m using the below code i am getting the result as a string and not as a number.

       

       

       

       

       

      <?xml version="1.0" encoding="utf-8"?>

      <mx:Application

       

      xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"

      >

       

      <mx:Script>

      <![CDATA[

       

       

      varfirstNo = 20

       

       

      var secondNo = 10

       

       

      var operatorSym = "-"

       

       

       

      function

      showResult()

      {

      reslutTxt.text = firstNo+operatorSym+secondNo

      }

       

      ]]>

      </mx:Script>

      <mx:TextInput

       

      x="305" y="205" id="reslutTxt" creationComplete="showResult()"

      />

       

      Result of this is showing as  20+10, but it should be 30. Pls help on this.