Number
/**
* 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/zG6w
*/
package {
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.events.Event;
import flash.ui.Mouse;
import flash.text.TextFormat;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.geom.Point;
[SWF(width=465,height=465,backgroundColor=0xFFFFFF,frameRate=60)]
public class FB0026 extends Sprite {
public var sw:Number=stage.stageWidth;
public var sh:Number=stage.stageHeight;
public var _myNum:Number=0;
public var _myStr:String="";
public var _mySet:Array=new Array ;
public var _myArray:Array = new Array();
public function FB0026() {
stage.addEventListener(MouseEvent.MOUSE_DOWN,xDown);
}
public function xDown(e:MouseEvent):void {
var mySprite:Sprite=new Sprite ;
mySprite.x=sw*Math.random();
mySprite.y=sh*Math.random();
addChild(mySprite);
var _myBox:String;
_myBox=String(_myNum);
_myNum++;
var _myTxt:TextField=new TextField ;
_myTxt.autoSize=TextFieldAutoSize.LEFT;
var format:TextFormat=new TextFormat(null,Math.random()*100+20);
_myTxt.defaultTextFormat=format;
_myTxt.text=_myBox;
var bmd:BitmapData=new BitmapData(_myTxt.width,_myTxt.height,true,0x000000);
bmd.draw(_myTxt);
var bm:Bitmap=new Bitmap(bmd);
bm.smoothing=true;
bm.x=- bm.width/2;
bm.y=- bm.height/2;
mySprite.addChild(bm);
var px:Number=Math.random()*sw;
var py:Number=Math.random()*sh;
mySprite.addEventListener(Event.ENTER_FRAME,xEnter);
function xEnter(e:Event):void {
mySprite.x += (px - mySprite.x)/100;
mySprite.y += (py - mySprite.y)/100;
mySprite.rotation += 1;
mySprite.rotationX += 1.5;
mySprite.rotationY += 1.5;
mySprite.alpha-=0.005;
if (mySprite.alpha<0) {
mySprite.removeEventListener(Event.ENTER_FRAME,xEnter);
removeChild(mySprite);
}
}
}
}
}