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

forked from: forked from: ハートがクルヒラ。

パワー不足のマシンだと苦しむこと請け合い。すみませんです。
/**
 * Copyright neconi ( http://wonderfl.net/user/neconi )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/sN5m
 */

// forked from kagetiyo523's forked from: ハートがクルヒラ。
// forked from kagetiyo523's ハートがヒラヒラ。
//パワー不足のマシンだと苦しむこと請け合い。すみませんです。
package {
    import flash.display.*
    //import flash.display.MovieClip;
    import flash.events.Event;
    import flash.geom.Point;
    import flash.geom.Rectangle;
    import frocessing.color.ColorHSV;
    import flash.display.BlendMode;
    import flash.filters.BlurFilter;
    //import net.hires.debug.Stats;
    [SWF(width="400", height="400", backgroundColor="#000000", frameRate="30")]    
    public class menyHearts extends Sprite {
		private var temp:BitmapData;
        public function menyHearts() {
        	   var bmpData:BitmapData = new BitmapData(465,465,false,0x0);
           var bmp:Bitmap = new Bitmap(bmpData);
           addChild(bmp);
           //addChild(new Stats());
           transform.perspectiveProjection.projectionCenter = new Point(stage.width/2, stage.height/2);
           addEventListener(Event.ENTER_FRAME,addHeart);
        }
        
        private function addHeart(e:Event):void{
           var rX:int =  Math.random() * stage.stageWidth;  
           var rY:int =  Math.random() * stage.stageHeight; 
           var color:ColorHSV = new ColorHSV(0, 0.4, 1);
           color.h = Math.random()*360;
           var heart:Sprite = new Heart(color.value
                                          ,rX
                                          ,rY);
           stage.addChild(heart);
           heart.blendMode = BlendMode.ADD;
        }
    }
}

    //import flash.display.MovieClip;
    import flash.display.Sprite;
    import flash.events.Event;
    class Heart extends Sprite{
      public function Heart(color:int
                               ,beginX:int
                               ,beginY:int):void{
         x = beginX;
         y = beginY;
         graphics.beginFill(color);
         //graphics.lineStyle(3.0, 0x000000);//線の太さで気持ち程度に滑らかさを演出(`・ω・´)
         graphics.moveTo(0, 0); 
         //右と左分けて作ったものをくっつけてひとつにした方がいいんじゃないか。ハートだし。
         //ここから左半分
         graphics.curveTo(-5 , -25, -30, -30);
         graphics.curveTo(-50, -25, -50, 0);
         graphics.curveTo(-50,  10,   0, 65); 
         //ここから右半分
         graphics.curveTo(50,  10, 50, 0); 
         graphics.curveTo(50, -25, 30, -30); 
         graphics.curveTo(5 , -25,  0, 0); 
         graphics.endFill();
         
         var rnd:Number = Math.random()*0.8 + 0.4; 
         scaleX = rnd;
         scaleY = rnd;
         addEventListener(Event.ENTER_FRAME,fadeOut);
      }

      private function fadeOut(e:Event):void{
     
         alpha -= 0.02;
         y -= 0.02*y;
         scaleX = scaleY *= 0.96;
         rotationY += 5;
         if (alpha<0){
           stage.removeChild(this);
         }
      }
    }