FlasherTest

by yd_niku
to @chomeco http://d.hatena.ne.jp/chomeco/20100413/1271243823
♥2 | Line 57 | Modified 2010-04-16 15:17:13 | MIT License
play

ActionScript3 source code

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

//to @chomeco http://d.hatena.ne.jp/chomeco/20100413/1271243823
package {
    import flash.display.*;
    import flash.text.*;
    public class FlasherTest extends Sprite {
        public function FlasherTest() {
            // write as3 code here..
            var すぎゃーん:全裸 = new 全裸("ずぎゃーん");
            すぎゃーん.x = 232;
            すぎゃーん.y = 232;
            addChild( すぎゃーん );
            
            var message:TextField = new TextField();
            var tf:TextFormat = new TextFormat();
            tf.align = "center";
            message.defaultTextFormat = tf;
            message.y = 360;
            message.width = 465;
            message.height = 32;
            message.text = "僕すぎゃーん。全裸なの。僕に服を着せてよ!!";
            addChild(message);
        }
    }
}

import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFormat;
class 全裸 extends Sprite{
    private var _skinColor:uint = 0;
    public function 全裸( name:String ){
        super();
        super.name = name;
        
        _skinColor = 0xCC9966;
        draw();
    }
    protected function draw():void{
        graphics.beginFill( _skinColor );
        const angle:Number = Math.PI*2 / 10;
        const offsetAngle:Number = -Math.PI/2;
        for( var i:int=0; i< 10;++i ){
            var isOut:Boolean = i%2 == 0;
            var r:Number = isOut ? 100: 60;
            var tx:Number = Math.cos( angle*i + offsetAngle )*r;
            var ty:Number = Math.sin( angle*i + offsetAngle )*r;
            if( i ==0 ) graphics.moveTo( tx, ty );
            graphics.lineTo( tx, ty );
        }
        graphics.endFill();
        
        graphics.beginFill( _skinColor );
        graphics.drawCircle( 0,-100, 60 );
        graphics.endFill();
        
        var :TextField = new TextField();
        .defaultTextFormat = new TextFormat("_sans", 36, 0x0, true )
        .autoSize = "left";
        .text = "す"
        .x = -18;
        .y = -140;
        addChild(  );
    } 
}

Forked