flash on 2009-12-14
新エディタのテスト。いいすねー。
/**
* Copyright ish_xxxx ( http://wonderfl.net/user/ish_xxxx )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/2wXw
*/
//新エディタのテスト。いいすねー。
package {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import org.libspark.betweenas3.*;
import org.libspark.betweenas3.easing.*;
import org.libspark.betweenas3.tweens.*;
[SWF(frameRate="60",backgroundColor="#000000")]
public class FlashTest extends Sprite {
protected var cont:Sprite,bmd:BitmapData,bmp:Bitmap,c:ColorTransform = new ColorTransform(1.25,1,0.895,0.825);
public function FlashTest() {
cont = addChild( new Sprite ) as Sprite;
cont.visible=false;
this.addChildAt(bmp=new Bitmap( bmd=new BitmapData(450,450,true,0xFFFFFF) ),0);
this.addEventListener("enterFrame",render);
}
protected function render(ev:Event):void
{
var s:Shape = cont.addChild( new Shape ) as Shape;
var g:Graphics = s.graphics;
var w:Number = Math.random()*20;
var h:Number = w;
s.x=225;s.y=450;s.z = 0;
s.scaleX = s.scaleY = 0;s.rotation = Math.random()*360-Math.random()*360;
g.beginFill(Math.random()*0xFFFFFF);
g.drawRect(-w/2,-w/2,w,h);
g.endFill();
var t:IObjectTween = BetweenAS3.bezierTo(
s,{x:Math.random()*450,y:100+Math.random()*300,z:Math.random()*100-Math.random()*100,scaleX:0,scaleY:0,rotation:Math.random()*360-Math.random()*360},{x:225,y:0,scaleX: 1.5,scaleY:1.5},2.5,Expo.easeOut
);
t.onComplete = kill;
t.onCompleteParams = [s];
t.play();
bmd.draw(cont,new Matrix());
bmd.colorTransform(bmd.rect,c);
}
protected function kill(__target:Shape):void
{
cont.removeChild( __target );__target = null;
}
}
}