Simpla add variables question

Okies, i am doing something very stupid 8] , i have 2 input variable fields.
When i press the button to add them, it won’t add together, instead it places the variables from both fields next to each other.
Finalcost is the field which shows the total amount. totalcost & totalcost2 are the input fields.
here is the code,

on(release){
_root.mailer.finalcost = ("$") + Number(_root.totalcost+_root.totalcost2);
}

any ideas??? :nerd:

on(release){
cost = _root.totalcost + _root.totalcost2;
_root.mailer.finalcost = "$" + cost;
}

that should work, I think…

hey Jubba!
Thanks for ya speedy reply,
tried but still puts totalcost2 after totalcost, and doesn’t add…

Strange, …

try


on(release){
        cost = Number(_root.totalcost) + Number(_root.totalcost2);
        _root.mailer.finalcost = "$" + cost;
}

that might work…

Thanks a heap JUBBA
Knew i was being stupid… =)
Once again u help the cause!.

thanks a bunch!

  • Sends Jubba virtual keg!