Action Script error 1006 in output
Hello there, I am quite new to Action Script 3.0 and I seem to have some complications with my coding. It works fine when I test it in the movie; however, when I put an amount over 150, I get an output error #1006: value is not a function. I am pretty sure my problem is in the last two "else if" statements since I am trying to make the answer of the equation appear when I put an amount over 150 mins. Any help will be much appreciated.
// This line makes the button, btnCalculate wait for a mouse click
// When the button is clicked, the determineCost function is called
btnCalculate.addEventListener(MouseEvent.CLICK, determineCost);
// These lines make the textinput and the radioButtons wait for a mouse click
// When these components are clicked, the clearLabels function is called
txtinMass.addEventListener(MouseEvent.CLICK, clearLabels); FirstRadio.addEventListener(MouseEvent.CLICK, clearLabels);
SecondRadio.addEventListener(MouseEvent.CLICK, clearLabels);
// This is the determineCost function
// e:MouseEvent is the click event experienced by the button
// void indicates that the function does not return a value
function determineCost(e:MouseEvent):void
{
// declare the variables
var Mass:uint;
var Firsts:String;
var Seconds:String;
// get the mass from the user
Mass = int(txtinMass.text);
// FirstGroup.group determines the group that FirstRadio is in
// .selectedData gets the value of the RadioButton that is selected from the group
Firsts = String(FirstRadio.group.selectedData);
Seconds = String(SecondRadio.group.selectedData);
// determine the cost
if (Mass <= 30 && Firsts == "First Class")
{
lblCost.text = "0.38";
}
else if (Mass <= 30 && Seconds == "Second Class")
{
lblCost.text = "0.28";
}
else if (Mass > 30 && Mass <= 50 && Firsts == "First Class")
{
lblCost.text = "0.55";
}
else if (Mass > 30 && Mass <= 50 && Seconds == "Second Class")
{
lblCost.text = "0.40";
}
else if (Mass > 50 && Mass <= 100 && Firsts == "First Class")
{
lblCost.text = "0.73";
}
else if (Mass > 50 && Mass <= 100 && Seconds == "Second Class")
{
lblCost.text = "0.55";
}
else if (Mass > 100 && Firsts == "First Class")
{
lblCost.text = (0.73 + 0.24 * ((Mass - 100) / 50))();
}
else if (Mass > 100 && Seconds == "Second Class")
{
lblCost.text = (0.55 + 0.19 * ((Mass - 100) / 50))();
}
}
// This is the clearLabels function
// e:MouseEvent is the click event experienced by the textInput and the radioButtons
// void indicates that the function does not return a value
function clearLabels(e:MouseEvent):void
{
lblCost.text = "";
txtinMass.text = "";
}