# Calculator question

**URL:** <https://forum.kirupa.com/t/calculator-question/282944>\
**Category:** Uncategorized\
**Created:** [February 28, 2009, 1:41am UTC](https://forum.kirupa.com/t/calculator-question/282944 "2009-02-28T01:41:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joakinrox](https://avatars.discourse-cdn.com/v4/letter/j/8dc957/32.png) [@joakinrox](https://forum.kirupa.com/u/joakinrox)\
**Post date:** [February 28, 2009, 1:41am UTC](https://forum.kirupa.com/t/calculator-question/282944/1 "2009-02-28T01:41:45Z")

</div>

hi ppl :P, i realize that this are probably stupid questions, but the last time i used flash was in flash mx and ALOT has changed… and i have been unable to find a tutorial that explains two things that i need:

1- i am trying to get the user to introduce a number into a textbox(input text right?)  
and after pushing button “x” the output box (dinamic text) shows the input+2…

```
i followed this tutorial: 
   http://www.quantunet.com/flash8/skills/sample/input_text_field_process.html

so, as i start doing this i realize that for some reason flash 8 doesnt take the parameter "variable" in a text box so i make a file with actionscript 2.0 and still i get no luck.. this is the code i used being the instance names for: button "enter_btn" input text "input" and the dynamic text "output"

```

> 

enter\_btn.onRelease = function ()  
{  
output=2 + input;

}  
So, when i run the flash movie and i hit the button i get a [COLOR=Navy]“nan”[/COLOR] (not a number), so i assume input is not an integer but a string so i use the function [COLOR=Red]parseInt()[/COLOR], and still get a “nan”. the only way for me not to get a [COLOR=Navy]nan[/COLOR] is by setting output=input. but thats kinda useless isnt it?"

so my questions are:  
why didnt this worked?  
how could i make this on as 3.0?  
could i make the calculator automatic? i mean changing the output without stepping on a button?, how?.

off topic question: how would i get data stored in an external .txt file?, and readed from an external file? (a link that explains it would do too :P)
