Getting the length of a dynamic text box

Can anyone help me with this problem

i’m wanting to get the lenght of the string in a dynamic textbox, but when i use the .length() method it returns undefined.

what am i doing wrong???

btw the actionscript i am using is simply


dynamictxtboxVar.length()