3 Replies Latest reply on Jun 27, 2010 7:23 PM by kglad

    Data Entered and Calculated to Answer

    mach6ix

      Hello Everyone,

       

      I am interested if anyone could suggest some self help options as I wish to learn how one would create a tool that would provide allow the end user to enter numbers, in some predetermined/static fields. The tool would then use this data and provide the answer.

       

      Simply put, i'm looking to create a basic ROI calculator (Return on Investment).

       

      Any suggested templates, instructional videos/sites that deal with data entry/calculation via AS1 or AS2, would be greatly appreciated.

       

      Cheers,

       

      Mike

        • 1. Re: Data Entered and Calculated to Answer
          kglad Adobe Community Professional & MVP

          use input textfields to allow users to enter data and create a button to trigger your calculation.  there's not much to an roi other than casting the input textfields' text property as a number.

          • 2. Re: Data Entered and Calculated to Answer
            mach6ix Level 1

            Thanks for your quick help kglad.

             

            That would be the face of the utility however i'm more curious about the backend of the tool.

             

            I'm looking for info on how to have the calculation completed straight in actionscript. I know what fields need to be added/multiplied/divided by what and will be looking for info how to use "data fields" in Flash, however it's the scripting of the calculation i'm looking for help with as well.

             

            Can Actionscript complete math calculations and if so, i'm looking for examples or tutorials that I could learn from.

             

            Thanks again kglad.

            • 3. Re: Data Entered and Calculated to Answer
              kglad Adobe Community Professional & MVP

              sure.  you have the most commonly used unary operators + (addition), - (subtraction),* (multiplication), / (division) (check the help files index first entry, symbols, for the other unary operators) and you have the Math class you can use.

               

              in the help files, check the Math class to see what's available but for roi, you'll most likely be use the Math.pow() function and the unary operators