PDA

View Full Version : please help with variables


ill_educated
06-26-2003, 08:29 AM
ok I started actionscripting with something simple, I want to have 2 input texts, 1 dynamic text and a button.
I want to enter a number in each input text, add them (+) and have the result shown in the dynamic text. The problem is that flash understands the vars as strings. I've read in a book that u don't need to declare the type of the var (string,numeric,...) and that flash recongize the type automatically.Why this is not happening in this case???

here is the code:
on (release)
{
var number1;
var number2;
apot=number1+number2;
}

magicwand
06-26-2003, 08:36 AM
apot=Number(number1)+Number(number2)

ill_educated
06-26-2003, 08:45 AM
thanks