2 Replies Latest reply on Apr 28, 2007 10:01 PM by mik7009

    math calculations with text input fields

    mik7009
      I am trying to convert an excel spreadsheet into a workable flash .swf.
      I took all the cells from the spreadsheet, and used input text fields in flash to try and duplicate what the spreadsheet does.
      I want this flash program to allow users to input numbers into several input text fields and then use math calculations to generate the rest of the input fields automatically.

      For example: I created a input text field, variable name for field is You_sponsored. I have another input text field named, average_BV_level1. I need to multiple the values in these two fields and displace the product of these two fields in another
      input text field. How do I go about doing this? Or is there a better method to reach the same result.
        • 1. Re: math calculations with text input fields
          PChiranjeevi Level 1
          try this one

          where

          "aa" is a movieClip/button on stage
          "You_sponsored" is a input Text field
          "average_BV_level1.text" is another inputTextField
          "result_is" is a Dynamic text field where I used to display the multiple result of the above text fields when clicking he button
          "NAN" may display if you use other than numbers.
          aa.onRelease = function() {
          result_is.text = Number(You_sponsored.text)*Number(average_BV_level1.text);
          };

          hope you get it
          • 2. Re: math calculations with text input fields
            mik7009 Level 1
            is there any other way to go about this.
            I do not want to have a submit or calculate button for the user to click on.
            I want the input text fields to update automatically when the user changes the numbers in certain fields.
            Just like spreadsheet calculations would do in excel.
            thank you for your help.
            I will study your response closely.