I am attempting to develop a flash presentation which will
calculate the amount of time/money saved to our customers in using
the service we provide. I wanted some (simple?) actionscript to sum
values they enter in text boxes. Can anybody point me in the right
direction? The idea came from the mortgage shrinker here at :
Not really anything to it. Just remember that – are you
ready for this? – number put into TEXT BOXES are considered
text (strings) by Flash.
So look up partInt() or parseFloat() in the help files to
help you change the text to numbers.
Then basically you will need to read through the help files
for the textField class to see what you can use there.
Finally remember that Flash (like any other binary based
system doing decimal math) has the occasional craziness when doing
math. So sometimes you will get and answer like 15.000000000001
when you expected 15. There are several threads around here dealing
with this. A general solution would be to use Math.round() or some
such to make sure the number is as you expect.