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

mixi的な forked from: flash on 2009-5-5

マックで見るとずれてました...
テック煮さんから
Get Adobe Flash player
by sw_lucchini 20 May 2009
    Embed
// forked from yo0_0oy's flash on 2009-5-5
// マックで見るとずれてました...
//テック煮さんから
package {
    import flash.display.Sprite;
    import flash.display.*;
    import flash.filters.*;
    import flash.geom.*;
	import flash.text.TextField;
	import flash.text.TextFormat;
    
    public class iPhoneButton extends Sprite
    {
        private const color:int = 0xED8000;
        private const SIZE:int = 150;
        private const ROUND:int = 25;
        
        public function iPhoneButton():void
        {
            var matrix:Matrix = new Matrix();
            matrix.createGradientBox(SIZE, SIZE, Math.PI / 2);
            
            var base:Shape = new Shape();
            base.graphics.beginFill(color);
            base.graphics.drawRoundRect(0, 0, SIZE, SIZE, ROUND, ROUND);
            addChild(base);

            var border:Shape = new Shape();
            border.graphics.lineStyle(1, 0xffffff, 1);
            border.graphics.lineGradientStyle("linear", [0xffffff, 0xffffff, 0xffffff], [1, 0.3, 1], [0, 128, 255], matrix);
            border.graphics.drawRoundRect(1, 1, SIZE - 2, SIZE - 2, ROUND, ROUND);
            border.blendMode = BlendMode.OVERLAY;
            addChild(border);

            var glowTop:Shape = new Shape();
            glowTop.graphics.beginGradientFill("linear", [0xffffff, 0xffffff], [1, 0.2], [0, 128], matrix);
            glowTop.graphics.drawEllipse(-SIZE / 2, -SIZE / 2, SIZE * 2, SIZE);
            glowTop.blendMode = BlendMode.NORMAL;
            addChild(glowTop);
            var mask:Shape = new Shape();
            mask.graphics.beginFill(0);
            mask.graphics.drawRoundRect(0, 0, SIZE, SIZE, ROUND, ROUND);
            //addChild(mask);
            glowTop.mask = mask;

            var glowBottom:Shape = new Shape();
            glowBottom.graphics.beginGradientFill("linear", [0x000000, 0x000000], [1, 0], [50, 255], matrix);
            glowBottom.graphics.drawRoundRect(0, 0, SIZE, SIZE, ROUND, ROUND);
            glowBottom.blendMode = BlendMode.OVERLAY;
            addChild(glowBottom);
            
			//文字
            var txt:TextField = new TextField();
			txt.x = 34;
			txt.y = 10;
			var tf:TextFormat = new TextFormat();
			tf.size = 100;
			tf.color = 0xFFFFFF;
			txt.defaultTextFormat = tf;
			txt.text = "m";
			addChild(txt);

            var filter:DropShadowFilter = new DropShadowFilter(2, 90, 0x000000, 0.7);
            base.filters = [filter];
        }
    }

}