forked from: forked from: forked from: forked from: 文字のテスト
import net.hires.debug.Stats;
♥0 |
Line 58 |
Modified 2011-04-07 12:17:52 |
MIT License
archived:2017-03-20 15:00:04
ActionScript3 source code
/**
* Copyright roll.sagawa ( http://wonderfl.net/user/roll.sagawa )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/uV2L
*/
// forked from hacker_kubrick's forked from: forked from: forked from: 文字のテスト
// forked from capoxi's forked from: forked from: 文字のテスト
// forked from yasai's forked from: 文字のテスト
// forked from nacookan's 文字のテスト
package {
import com.flashdynamix.motion.*;
import flash.display.*;
import flash.events.MouseEvent;
import flash.filters.BlurFilter;
import flash.text.*;
import fl.motion.easing.*;
// import net.hires.debug.Stats;
public class FlashTest extends Sprite {
public function FlashTest() {
// addChild( new Stats() );
init();
}
private function init():void {
var format:TextFormat = new TextFormat();
format.font = 'Arial';
format.size = 36;
var text:TextField = new TextField();
var text1:TextField = new TextField();
text.defaultTextFormat = format;
text.text = 'ROLL ';
text1.text = 'motion';
text.autoSize = TextFieldAutoSize.CENTER;
var bmpd:BitmapData = new BitmapData(text.textWidth, text.textHeight, true, 0xffffffff);
bmpd.draw(text);
// bmpd.draw(text1);
var s:Number = 4;
var i:Number = 0;
var timeline:TweensyTimeline = new TweensyTimeline();
for(var xx:Number = 0; xx < bmpd.width; xx++){
for (var yy:Number = 0; yy < bmpd.height; yy++) {
if(bmpd.getPixel(xx, yy) == 0xffffff) continue;
var sp:Sprite = generateSp(s);
addChildAt(sp,0);
timeline = Tweensy.to(sp, { x: xx * s, y: yy * s + 100, z: 0 }, 1, Sine.easeOut, i);
i+= 0.0125;
}
}
stage.addEventListener(MouseEvent.CLICK, function(e:MouseEvent):void {
stage.removeEventListener(MouseEvent.CLICK, arguments.callee);
allRemoveChild();
init();
});
}
private function allRemoveChild():void {
for (var i:Number = numChildren - 1; i >= 0; i--) {
var child:* = getChildAt(i);
// var stats:Stats = child as Stats
// if (stats != null) continue;
removeChild(child);
}
}
private function generateSp(s:Number):Sprite {
var sp:Sprite = new Sprite();
sp.graphics.beginFill((0xDDDDDD));
sp.graphics.drawCircle(0, 0, s / 2);
sp.graphics.endFill();
// sp.x = Math.random() * 400;
sp.x = (Math.random() * 400) + stage.stageWidth + 10;
sp.y = (Math.random() * stage.stageHeight);
// sp.z = Math.random() * 1000;
return sp;
}
}
}