I’m making a calculator in Flash CS3 using actionscript 3.0.
It has the Multiply, Divide, Plus & Minus buttons.
When i input the code for one button, that button works, but when i input the code for more than one, none of the buttons work.
**What am I doing wrong? **
MinusButton_btn.addEventListener(MouseEvent.CLICK, doMyCalculation);
function doMyCalculation(e:MouseEvent):void
{
var total : Number;
// PROCESS
total = Number(N1.text)-Number(N2.text);
// OUTPUT
total.text = String(myAnswer);
};
MultiplyButton_btn.addEventListener(MouseEvent.CLICK, doMyCalculation);
{
var total : Number;
// PROCESS
total = Number(N1.text)*Number(N2.text);
// OUTPUT
total.text = String(myAnswer);
};
DivideButton_btn.addEventListener(MouseEvent.CLICK, doMyCalculation);
{
var total : Number;
// PROCESS
total = Number(N1.text)/Number(N2.text);
// OUTPUT
total.text = String(myAnswer);
};
PlusButton_btn.addEventListener(MouseEvent.CLICK, doMyCalculation);
{
var total : Number;
// PROCESS
total = Number(N1.text)+Number(N2.text);
// OUTPUT
total.text = String(myAnswer);
}
Thanks guys :ne: