Question:
Flash and the dreaded NaN?
anonymous
2009-05-18 15:52:35 UTC
I'm beginning to learn flash and need a little help with an error I getting with actionscript 2.0.
I want to make a simple calculator. It has two input text fields called first and second. It has a dynamic text box called total. And two symbols which are buttons.
I'm using action script to take the input in the two fields and either add them or subtract them depending on which button is press and display them in the dynamic box. My code follows:

on (release) { total = Number(first) + Number(second);}.

No matter what I do when it tries to take Number() it always returns a NaN error. I have even embed only numerals in my text box and still the error persists.
Three answers:
Mae
2009-05-18 21:43:47 UTC
That calculator is for flash player 5.



Go to File>Publish Settings, on the Flash Tab go to "Version" and change it to "Flash Player 5".



Should work, it did it for me ;)
anonymous
2016-12-15 22:20:30 UTC
Nan Flash
Shishkani
2009-05-18 16:09:11 UTC
Total is a text box. Can you assign the result of a numeric operation to it? Perhaps you should assign it to a Number first and then put it into a text box.



I'm just guessing, since I don't actually work in Flash.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...