block5
/**
* Copyright Maeda_addevent ( http://wonderfl.net/user/Maeda_addevent )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/5MaU
*/
package {
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.events.Event;
import flash.geom.Point;
[SWF(width=465,height=465,backgroundColor=0xFFFFFF,frameRate=60)]
public class FB00009 extends Sprite {
public var sw:Number=stage.stageWidth;
public var sh:Number=stage.stageHeight;
public var r:Number;
public var _mySprite:mySprite;
public var num:uint = 0;
public function FB00009() {
stage.addEventListener(MouseEvent.MOUSE_DOWN,xDown);
}
public function xDown(e:MouseEvent):void {
r = 15;
_mySprite = new mySprite(r);
_mySprite.x = sw/2;
_mySprite.y = -10;
addChild(_mySprite);
num++;
_mySprite.addEventListener(Event.ENTER_FRAME,xEnter);
}
public function xEnter(e:Event):void {
e.target.y += 8;
if (e.target.y >= (sh-e.target.height/2*(num+1))) {
e.target.removeEventListener(Event.ENTER_FRAME,xEnter);
}
}
}
}
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
class mySprite extends Sprite {
public var color:Number = Math.random() * 0xFFFFFF;
public function mySprite(r:Number) {
var g=this.graphics;
g.lineStyle(0.5,0x000000,0,false,"none");
g.beginFill(color,0.6);
g.moveTo(0,0);
g.lineTo(r*0.865,r/2);
g.lineTo(0,r);
g.lineTo(-r*0.865,r/2);
g.lineTo(0,0);
g.endFill();
g.lineStyle(0.5,0x000000,0,false,"none");
g.beginFill(color,1);
g.moveTo(-r*0.865,r/2);
g.lineTo(0,r);
g.lineTo(0,r*2);
g.lineTo(-r*0.865,r*1.505);
g.lineTo(-r*0.865,r/2);
g.endFill();
g.lineStyle(0.5,0x000000,0,false,"none");
g.beginFill(color,0.8);
g.moveTo(0,r);
g.lineTo(r*0.865,r/2);
g.lineTo(r*0.865,r*1.505);
g.lineTo(0,r*2);
g.lineTo(0,r);
g.endFill();
}
}