flash on 2010-3-5

by akisute
♥0 | Line 34 | Modified 2010-03-05 17:26:37 | MIT License
play

ActionScript3 source code

/**
 * Copyright akisute ( http://wonderfl.net/user/akisute )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/l3q3
 */

package {
    import flash.display.*;
    import flash.text.*;
    
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..
            this.graphics.beginFill(0xFF0000);
            this.graphics.lineStyle(4.0, 0x000000);
            this.graphics.moveTo(100,100);
            this.graphics.lineTo(200,100);
            this.graphics.lineTo(200,200);
            this.graphics.lineStyle(0.0, 0x000000, 0.0);
            //this.graphics.lineTo(100,100);
            this.graphics.endFill();
            
            var fmt:TextFormat = new TextFormat();
			fmt.font = "_ゴシック"; 
			fmt.size = 13
			
			var tf:TextField = new TextField();
			tf.defaultTextFormat = fmt;
			tf.width = 1000;
			tf.text = "あああいいいうううえ";
			tf.autoSize = TextFieldAutoSize.LEFT;
			tf.wordWrap = true;
			tf.x = 100;
			tf.y = 300;
			tf.width = Math.min(tf.textWidth+10, 180);
			this.addChild(tf);
			
			this.graphics.lineStyle(2.0, 0x0000FF);
			this.graphics.moveTo(tf.x, tf.y);
			this.graphics.lineTo(tf.x+tf.width, tf.y);
			
			this.graphics.lineStyle(2.0, 0x000099);
			this.graphics.moveTo(tf.x, tf.y-5);
			this.graphics.lineTo(tf.x+180, tf.y-5);
        }
    }
}