Skip to main content
Participant
April 30, 2013
Question

Simple Calculator help

  • April 30, 2013
  • 1 reply
  • 533 views

I need an Action Script code that will take a user input number, and divide it by 3 different numbers and display the results accordnigly. I've tried 4 or 5 different examples but nothing seems to work, please help,

CB

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
April 30, 2013

what do you mean by, "...display the results accordingly"?

Participant
April 30, 2013

There are 3 text boxes that would display the result from each equation, it's a product calculator

Participant
April 30, 2013

So I found the answer to my problem and here is the code if anyone else needs it;

function calcClick(event:MouseEvent):void

{

          var userNum:Number = Number(userNum.text);

          var total_1:Number = userNum / 400;

          silRes.text = String(total_1);

 

          var total_2:Number = userNum / 2500;

          finishRes.text = String(total_2);

 

          var total_3:Number = userNum / 500;

          colorRes.text = String(total_3);

}