# Adding two numbers

**URL:** <https://forum.kirupa.com/t/adding-two-numbers/221961>\
**Category:** Uncategorized\
**Created:** [April 9, 2007, 5:55pm UTC](https://forum.kirupa.com/t/adding-two-numbers/221961 "2007-04-09T17:55:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nwglow](https://avatars.discourse-cdn.com/v4/letter/n/f1d935/32.png) [@nwglow](https://forum.kirupa.com/u/nwglow)\
**Post date:** [April 9, 2007, 5:55pm UTC](https://forum.kirupa.com/t/adding-two-numbers/221961/1 "2007-04-09T17:55:17Z")

</div>

I can’t get this work properly.There are three input text fields on stage with [COLOR=Magenta]var called entry1, entry2, and total[/COLOR]. When user enter the numbers in entry1 and entry2 input box and click the button, it will populate the total. The problem it gives me a \*\*NaN \*\*instead an actual number. How to fix the script?

function totalNum() {  
\_root.total = Number(\_root.entry1) + Number(\_root.entry2);  
}

Thanks
