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

りんご

Get Adobe Flash player
by hacker_cobulht0 20 Dec 2011
    Embed
/**
 * Copyright hacker_cobulht0 ( http://wonderfl.net/user/hacker_cobulht0 )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/5QbO
 */

package {     
    import flash.display.Sprite;
    import flash.events.*;
    
    [SWF(width = "465", height = "465", backgroundColor = 0xFF917A, frameRate = "60")]
    
    public class apple extends Sprite{
        private var _arr:Vector.<Sprite> = new Vector.<Sprite>
        
        public function apple(){
            if (stage) init();else addEventListener(Event.ADDED_TO_STAGE,init );
        }
        public function init(ev:Event = null){
            removeEventListener( Event.ADDED_TO_STAGE, init ) ;
            var bg:back_ground=new back_ground();
            addChildAt(bg,0);
            stage.addEventListener(MouseEvent.MOUSE_DOWN, clicks);
        }
        
        private function clicks(ev){
            var mc:drawApple=new drawApple;
            mc.x=mouseX;
            mc.y=mouseY;
            mc.scaleX=mc.scaleY=1.5;
            mc.name="Rabbit"+_arr.length;
            _arr.push(mc);
            addChild(mc);
        }
    
    }
}










import flash.display.Sprite;
import flash.display.Shape;
//import flash.filters.GlowFilter;
import flash.filters.DropShadowFilter;

import flash.display.GradientType;
import flash.display.SpreadMethod;
import flash.display.Graphics;
import flash.geom.Matrix;
import flash.display.BlendMode;

class drawApple extends Sprite{
public function drawApple(){    
    
    var container:Sprite = addChild(new Sprite) as Sprite;
    var matrix:Matrix = new Matrix;
    var sg:Shape = container.addChild(new Shape) as Shape;
    
    sg.graphics.lineStyle(1,0xFE6363,1);
    sg.graphics.drawCircle(0,0,20);
    sg.graphics.lineStyle(4,0xEE204D,0.3);
    sg.graphics.drawCircle(0,0,18.5);
    
    matrix.createGradientBox(50,50,0,-30,-32);
    sg.graphics.beginGradientFill(GradientType.RADIAL, [0xFD826C,0xE73E5B,0xFE5C5C,0xF54968,0xFE5C5C], [1,1,1,1,1], [20,100,120,200,255], matrix, SpreadMethod.PAD);
    sg.graphics.drawCircle(0, 0, 20);        
    this.graphics.endFill();
    
    
    //leaf
    var _cex:Number=15;
    var _cey:Number=0;
    
    var bh:Number=18;
    var dm:Number=10;
    var rd:Number=dm/2;
    sg =  container.addChild(new Shape) as Shape;
    
    matrix.createGradientBox(30, 30, 0, 0,0);
    sg.graphics.lineStyle(2,0x99ab4e,0.5);
    sg.graphics.beginGradientFill(GradientType.LINEAR, [0x99ab4e,0xc7dc68,0x99ab4e], [1,1,1], [50,125,190], matrix, SpreadMethod.PAD);
    
    //sg.graphics.beginFill(0xA9A735);
    sg.graphics.moveTo(_cex,_cey);
    sg.graphics.curveTo(_cex-dm,_cey-(bh-bh/2),_cex-dm,_cey-bh);
    //sg.graphics.lineTo(_cex-dm,_cey-bh);
    sg.graphics.curveTo(_cex-rd,_cey-(bh+dm),_cex,_cey-bh);
    sg.graphics.curveTo(_cex+rd,_cey-(bh+dm),_cex+dm,_cey-bh);
    sg.graphics.curveTo(_cex+dm,_cey-(bh-bh/2),_cex,_cey);
    //sg.graphics.lineTo(_cex,_cey);
    
    sg.rotation=-40;
    sg.graphics.endFill();
    
    filters = [ new DropShadowFilter(5,40, 0xBE064E, 0.5, 10, 5, 2 ) ] ; 
}
}





class back_ground extends Sprite{    
public function back_ground(){
    var bg:Sprite=new Sprite();
    bg.graphics.beginFill(0xF0415B,1);
    bg.graphics.drawRect(0,0,465,465);
    bg.graphics.endFill();
    for(var j:int=0; j < 1150; j++){
        var dot:Sprite=new Sprite();
        dot.graphics.beginFill(0xFF917A,1);
        dot.graphics.drawCircle(0,0,2.5);
        dot.graphics.endFill();
        dot.x=j%48*10;
        if(j%2==0){dot.y=Math.floor(j / 48)*20+10;}else{dot.y=Math.floor(j / 48)*20;}        
        bg.addChild(dot);
    }
    addChild(bg);    
}
}