Can anyone help with a switch/case problem?
I am using Flash8 and saving as mx2004 (if that helps matters any)
I keep receiving a [type Function] error in the dynamic text field, and cannot figure out for the life of me why!
here goes:
function totaltax() {
var pone:Number = Number (priceone_txt.text);
var ptwo:Number = Number (pricetwo_txt.text);
var salestax:Number = Number (salestax_txt.text);
var caamount:Number = (pone + ptwo) * .085;
var catotal:Number = (pone + ptwo + caamount);
var maamount:Number = (pone + ptwo) * .05;
var maship:Number = 5.00;
var matotal:Number = (pone + ptwo + maamount + maship);
var txamount:Number = (pone + ptwo) * .045;
var txtotal:Number = (pone + ptwo + txamount);
var scamount:Number = (pone + ptwo) * .05;
var sctotal:Number = (pone + ptwo + scamount);
trace(shipstate_txt.text);
shipstate_txt.text = shipstate_txt.text.toUpperCase;
trace(pone);
trace(ptwo);
trace(shipstate_txt.text);
ship = shipstate_txt.text;
switch(ship) {
case “MA”:
salestax_txt.text = maamount;
shipping_txt.text = maship;
grandtotal_txt.text = matotal;
customer_txt.text = “Your Total is”;
break;
case “CA”:
salestax_txt.text = caamount;
shipping_txt.text = caship;
grandtotal_txt.text = catotal;
customer_txt.text = “Your Total is”;
break;
case “TX”:
salestax_txt.text = txamount;
shipping_txt.text = txship;
grandtotal_txt.text = txtotal;
customer_txt.text = “Your Total is”;
break;
case “SC”:
salestax_txt.text = scamount;
shipping_txt.text = scship;
grandtotal_txt.text = sctotal;
customer_txt.text = “Your Total is”;
default:
final_txt.text = “You did not enter a valid state!”;
}
}
Thank you in advance!