6 Replies Latest reply on Apr 26, 2007 11:42 AM by Newsgroup_User

    Simple Actionscript problem

      Just received my new CS3 Web Premium in the mail yesturday and have been playing around with it, specially with flash. Do need some help with it though while I my trying to learn it. I have C++, VB, and PHP experience but have never really played around with actionscript as far as programing (used it to do basic event actions back in MX 2004). Anyways, to the point. I can't get this code to work. I am assuming I need to change the string to an integer, but not sure how.

      Here is the code:
      import fl.events.*;
      import flash.events.*;

      btnCalc.addEventListener(MouseEvent.CLICK, calculate);

      function calculate(e:Event):void {
      var Num1:Number = txtNum1.text;
      var Num2:Number = txtNum2.text;
      lblOutput.text = Num1 + Num2;