PDA

View Full Version : adding variables



Captain Poopy
April 14th, 2003, 06:38 PM
_root.onEnterFrame = function() {
I am creating a simple form. I have created several variables input through text boxes.
lets say for simplicity
var a
var b
var c
these varibles will be numbers and I want to add them.

total = a+b+c

I do this and it creates a string out of them. How do I make the **** thing add.
Thanks in advance
Cap. P

Jubba
April 14th, 2003, 06:43 PM
Number(total) = Number(a) + Number(b) + Number(c)

Captain Poopy
April 14th, 2003, 07:08 PM
Thanks a lot. One note though, you dont have to add the
Number(total) or you get an error. Just put the variable there.

Jubba
April 14th, 2003, 07:25 PM
i figured. :) I just got Number() happy.