# Text Cursor / Caret into TextField

**URL:** <https://forum.kirupa.com/t/text-cursor-caret-into-textfield/267948>\
**Category:** flash\
**Created:** [August 7, 2008, 2:46pm UTC](https://forum.kirupa.com/t/text-cursor-caret-into-textfield/267948 "2008-08-07T14:46:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![setcookie](https://avatars.discourse-cdn.com/v4/letter/s/4da419/32.png) [@setcookie](https://forum.kirupa.com/u/setcookie)\
**Post date:** [August 7, 2008, 2:46pm UTC](https://forum.kirupa.com/t/text-cursor-caret-into-textfield/267948/1 "2008-08-07T14:46:56Z")

</div>

hi guys i really dont get it … im trying to get the cursor the caret into a textfield on stage enterframe like this: im simply trying to get the cursor inzto the textfield on startup so people can type right away when the swf is loaded. what am i doing wrong?

```auto

package
{
    
    import flash.events.*;
    import flash.display.*;
    import flash.text.*;
    import flash.system.*;
    import flash.utils.*;
    import flash.geom.Point;
    import flash.ui.*;
    
    public class Test extends Sprite
    {
        
        public function Test():void
        {
            stage.addEventListener(Event.ENTER_FRAME, this._event)
        }
        
        protected function _event(e):void
        {
            stage.focus = this;
            this._field.tabEnabled = true;
            this._field.tabIndex = 0;
            this._field.text = "test";
            stage.focus = this._field;
            this._field.setSelection(0,this._field.length);
            this._field.text = "";
            stage.removeEventListener(Event.ENTER_FRAME, this._event)
        }
            
    }
    
}

```

the textField already is on stage in my .fla - is there any workaround. or should i take the textfield component instead of class

thx for help!

set\*
