Line
クリックでちょっと変わります。
/**
* 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/r5VZ
*/
package {
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.events.Event;
import flash.geom.Point;
import frocessing.color.ColorHSV;
[SWF(width=465,height=465,backgroundColor=0xFFFFFF,frameRate=60)]
public class FB00020 extends Sprite {
public var sw:Number=stage.stageWidth;
public var sh:Number=stage.stageHeight;
public var _mySprite:mySprite;
public var speed:Number=3;
public var px:Number = 0;
public var py:Number =0;
public var px2:Number = 2.5;
public var py2:Number = 0;
public var myCol:int=0;
public var mySet:Number = 1;
public var myPoint:Array = new Array("p1","p2","p3","p4");
public var myNum:Number = 0;
public function FB00020() {
this.graphics.beginFill(0x000000,1);
this.graphics.drawRect(0,0,sw,sh);
this.graphics.endFill();
stage.addEventListener(MouseEvent.MOUSE_MOVE,xMove);
stage.addEventListener(MouseEvent.MOUSE_DOWN,xDown);
}
public function xDown(e:MouseEvent):void {
myNum += 1;
if (myNum >= 4) myNum = 0;
}
public function xMove(e:Event):void {
var _color:ColorHSV=new ColorHSV(myCol+=1.5,1);
//var _myCol:Number=Math.random()*0xFFFFFF;
_mySprite=new mySprite(int(_color),myPoint[myNum]);
if (myNum == 0) {
_mySprite.x = mouseX;
_mySprite.y = mouseY;
} else if (myNum == 1) {
_mySprite.x = mouseX;
_mySprite.y = mouseY;
} else if (myNum == 2) {
_mySprite.x = mouseX;
_mySprite.y = mouseY;
} else if (myNum == 3) {
_mySprite.x = mouseX;
_mySprite.y = mouseY;
}
addChild(_mySprite);
}
}
}
import flash.display.Sprite;
import flash.events.Event;
import flash.filters.BlurFilter;
class mySprite extends Sprite {
public var myFil:BlurFilter=new BlurFilter(2,2,2);
public var myCol:Number;
public var _color:uint;
public var mySpeedY:Number = 0;
public var mySpeedX:Number = 0;
public var _myPoint:String;
public var myIntX:Number;
public var myIntY:Number;
public function mySprite(color:uint,myPoint:String):void {
_color=color;
_myPoint = myPoint;
this.graphics.beginFill(int(_color),1);
this.graphics.drawRect(0,0,1,1);
this.graphics.endFill();
addEventListener(Event.ENTER_FRAME,xEnter);
}
public function xEnter(e:Event):void {
if (_myPoint == "p1") {
mySpeedY += 1;
mySpeedX += 0;
if (mySpeedY >= 10) mySpeedY = 10;
if (this.scaleY >= 465) {
this.alpha -= 0.01;
if (this.alpha < 0) {
this.graphics.clear();
parent.removeChild(this);
this.removeEventListener(Event.ENTER_FRAME, xEnter);
}
}
} else if (_myPoint == "p2") {
mySpeedY = 0;
mySpeedX -= 1;
if (mySpeedX <= -10) mySpeedX = -10;
if (this.scaleX <= 0) {
this.alpha -= 0.01;
if (this.alpha < 0) {
this.graphics.clear();
parent.removeChild(this);
this.removeEventListener(Event.ENTER_FRAME, xEnter);
}
}
} else if (_myPoint =="p3") {
mySpeedY -= 1;
mySpeedX = 0;
if (mySpeedY <= -10) mySpeedY = -10;
if (this.scaleY <= 0) {
this.alpha -= 0.01;
if (this.alpha < 0) {
this.graphics.clear();
parent.removeChild(this);
this.removeEventListener(Event.ENTER_FRAME, xEnter);
}
}
} else if (_myPoint == "p4") {
mySpeedY = 0;
mySpeedX += 1;
if (mySpeedX >= 10) mySpeedX = 10;
if (this.scaleX >= 465) {
this.alpha -= 0.01;
if (this.alpha < 0) {
this.graphics.clear();
parent.removeChild(this);
this.removeEventListener(Event.ENTER_FRAME, xEnter);
}
}
}
this.scaleY += mySpeedY;
this.scaleX += mySpeedX;
this.rotation += 1;
// if (this.scaleY>465) || (this.scaleX{
// this.alpha -= 0.01;
// if (this.alpha < 0) {
// this.graphics.clear();
// parent.removeChild(this);
// this.removeEventListener(Event.ENTER_FRAME, xEnter);
// }
// }
}
}