////////////////////////////////////////////////////////////////////////////////
//
//  'MyClass' version 1.0.
//  Copyright 2009 [fraser], [china]
//  All Rights Reserved.
//
// - Description :
//  -
// - Function :
//  -
// - Notice :
//  -
// - Action sequence :
//  - Constructor() ->
//
////////////////////////////////////////////////////////////////////////////////
package
{
    import flash.text.* ;
    import flash.display.* ;
    import flash.events.* ;
    [SWF(width='800',height='600')]
    public class Demo extends Sprite{
        public function Demo(){
            if (stage) init();
            else addEventListener(Event.ADDED_TO_STAGE, init);
        }

        private function init(e:Event = null):void
        {
            removeEventListener(Event.ADDED_TO_STAGE, init);
            // entry point
            var text:TextField = new TextField();
            text.height = 20 ;
            text.background = true ;
            text.backgroundColor = 0x7c7c7c ;
            text.border = true ;
            text.borderColor = 0x000000;

            text.type = TextFieldType.INPUT ;
            addChild(text);

            stage.focus = text ; // here is set the cursor focus on
textField
        }
    }
}

2009/4/29 Anjum Shahzad <[email protected]>

>
>
>  Hi,
>
> I have a problem with TextInput.How to focus on the
> TextInput with cursor blinking when the application loads.
>
> plz help me.
>  
>

Reply via email to