In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

[TextField]FocusIn/Outのテスト

Get Adobe Flash player
by stenpel 24 May 2010
    Embed
/**
 * Copyright stenpel ( http://wonderfl.net/user/stenpel )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/hBp8
 */

package {
    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.events.*;
    public class FlashTest extends Sprite {
    	private var tf:TextField;
        public function FlashTest() {
            // write as3 code here..
            tf = new TextField();
            tf.addEventListener(FocusEvent.FOCUS_IN, onFocusIn);
            tf.addEventListener(FocusEvent.FOCUS_OUT, onFocusOut);
            addChild(tf);
            tf.text = "test";
            tf.border = true;
        }
        
        private function onFocusIn(e:FocusEvent):void {
        		tf.text = "FocusIn";
        }
        
        private function onFocusOut(e:FocusEvent):void {
        		tf.text = "FocusOut";		
        }
    }
}