# \[type Function\] error

**URL:** <https://forum.kirupa.com/t/type-function-error/187597>\
**Category:** flash\
**Created:** [April 30, 2006, 9:48pm UTC](https://forum.kirupa.com/t/type-function-error/187597 "2006-04-30T21:48:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![3693moonfire](https://avatars.discourse-cdn.com/v4/letter/3/73ab20/32.png) [@3693moonfire](https://forum.kirupa.com/u/3693moonfire)\
**Post date:** [April 30, 2006, 9:48pm UTC](https://forum.kirupa.com/t/type-function-error/187597/1 "2006-04-30T21:48:27Z")

</div>

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!
