# MaxChars actionscript created TextField

**URL:** <https://forum.kirupa.com/t/maxchars-actionscript-created-textfield/312560>\
**Category:** flash\
**Created:** [August 6, 2010, 1:52pm UTC](https://forum.kirupa.com/t/maxchars-actionscript-created-textfield/312560 "2010-08-06T13:52:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![LS05](https://avatars.discourse-cdn.com/v4/letter/l/e19b73/32.png) [@LS05](https://forum.kirupa.com/u/LS05)\
**Post date:** [August 6, 2010, 1:52pm UTC](https://forum.kirupa.com/t/maxchars-actionscript-created-textfield/312560/1 "2010-08-06T13:52:47Z")

</div>

Hi guys,  
I’ve searched in the forum but I haven’t find this issue.  
I’ve created a code that read the date of a day from xml and then put it into a textfield.  
Here the declaration of the textfield:

```auto
var dateTxt:TextField = new TextField();

```

After i set for the textfield a format and the maxchars property:

```auto

dateTxt.defaultTextFormat = txtSTit;
dateTxt.maxChars = 8;

```

But if I insert a number of charaters bigger that maxChars it is inserted in the textfield ingnoring the maxChars property.  
It’s because i’ve setted the defaultTextFormat before to set the maxChars property?  
Please help me.  
Thanks 😃
