# Converting string to a numeric value. help

**URL:** <https://forum.kirupa.com/t/converting-string-to-a-numeric-value-help/255505>\
**Category:** flash\
**Created:** [March 24, 2008, 5:28am UTC](https://forum.kirupa.com/t/converting-string-to-a-numeric-value-help/255505 "2008-03-24T05:28:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vandel212](https://avatars.discourse-cdn.com/v4/letter/v/85f322/32.png) [@Vandel212](https://forum.kirupa.com/u/Vandel212)\
**Post date:** [March 24, 2008, 5:28am UTC](https://forum.kirupa.com/t/converting-string-to-a-numeric-value-help/255505/1 "2008-03-24T05:28:13Z")

</div>

I’m trying to get my progam to get a value that a user inputs via a text input object. The name of the instance is “txtAge”. I want whatever the user puts into the textinput box to be converted from string to a numeric value and put into the variable “Age”. This is the line of code that keeps erroring out:

var Age:Number = txtAge;

I’ve I’ve tried searching the forums for a thread that explains it but I can’t find anything. I’m very new to Actionscript (1.0, 2.0, and 3.0) and my programing experience is in C# and VB. I don’t know how far off I am from getting this to work but I think I’m kind close.

Thanks in advance.
