PDA

View Full Version : simple math functions


David Bird
12-04-2001, 08:09 PM
Looking for a way to perform simple math functions in a Flash movie....I want to enter a value, enter another value, and get a result, i.e., multiply value1 - 5, by value2 - 4, result = 20
Any assistance would be greatly appreciated

tg
12-04-2001, 09:55 PM
var val1;
var val2;
var result;

val1=5;
val2=10;

result=val1*val2;


result is 50.

is that what your looking for?

David Bird
12-04-2001, 10:30 PM
Yep, that's it....A further question...what actionscript command do I use to get that where I want it?!

tg
12-04-2001, 11:49 PM
the simplest is to put a dynamic text box on the same timeline as the code and name it result.

the variable result will be displayed in the text box.