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

flash on 2016-7-21

Get Adobe Flash player
by karllitting 22 Jul 2016
    Embed
/**
 * Copyright karllitting ( http://wonderfl.net/user/karllitting )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/Km8x
 */

package {
    import flash.display.*;
    import flash.text.*;
    import flash.events.*;
    
    public class Main extends Sprite {
        private var textBox:TextField = new TextField();
        private var textView:TextField = new TextField();
        private var submit:TextField = new TextField();
        
        public function min(event:MouseEvent):void {
            submit.borderColor = 0xaaaaaa;
        }
        
        public function mout(event:MouseEvent):void {
            submit.borderColor = 0xdddddd;
        }
        
        public function submitClick():void {
            submit.borderColor = 0xdddddd;
            textView.text = "hello "+textBox.text;
        }
        
        public function submitEvent(event:MouseEvent):void {
            submitClick();
        }
        
        public function Main():void {
            textBox.text = "";
            textBox.type = TextFieldType.INPUT;
            textBox.border = true;
            textBox.opaqueBackground = 0xeeeeee;
            textBox.height = 20;
            textBox.y = 20;
            
            textView.text = "what's your name?";
            textView.autoSize = TextFieldAutoSize.LEFT;
            
            submit.text = "submit";
            submit.x = textBox.width + 8;
            submit.y = 20;
            submit.width = submit.textWidth + 4;
            submit.height = 20;
            submit.opaqueBackground = 0xeeeeee;
            submit.border = true;
            submit.borderColor = 0xdddddd;
            submit.addEventListener(MouseEvent.MOUSE_OVER,min);
            submit.addEventListener(MouseEvent.MOUSE_OUT,mout);
            submit.addEventListener(MouseEvent.CLICK,submitEvent);
            
            addChild(textView);
            addChild(textBox);
            addChild(submit);
        }
    }
}