Flashdevelopで初めて書いたお
得意の丸のランダムちゃうやつFlashdevelop使って書いてみました。
補完機能がすごくてめちゃくちゃ使いやすいかもっす!!
♥0 |
Line 30 |
Modified 2010-11-11 02:36:30 |
MIT License
archived:2017-03-20 02:45:41
ActionScript3 source code
/**
* Copyright plus-tic ( http://wonderfl.net/user/plus-tic )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/k2Jv
*/
package {
//得意の丸のランダムちゃうやつFlashdevelop使って書いてみました。
//補完機能がすごくてめちゃくちゃ使いやすいかもっす!!
import flash.display.Sprite;
import caurina.transitions.*;
import flash.events.MouseEvent;
public class Maru extends Sprite {
public var hako:Array = [];
public function Maru() {
for (var i:uint = 0; i < 1000; i++){
var maru:Sprite = new Sprite();
maru.graphics.beginFill(rand(0xffffff));
maru.graphics.drawCircle(0, 0, 10);
maru.graphics.endFill();
maru.x = rand(500);
maru.y = rand(500);
addChild(maru);
hako.push(maru);
this.addEventListener(MouseEvent.CLICK, ch);
}
}
public function ch(e:MouseEvent):void {
for (var j:uint = 0; j < hako.length; j++) {
var mc:Sprite = hako[j];
Tweener.addTween(mc, { transition:"easeInout", time:2, x:rand(500), y:rand(500) } );
}
}
public function rand(num:Number):Number {
return Math.random() * num;
}
}
}