flash on 2009-3-14
package {
import flash.display.Sprite;
import caurina.transitions.Tweener;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.events.*;
import flash.filters.*;
public class FlashTest extends Sprite {
private var number:Number=0;
public function FlashTest() {
stage.frameRate=30;
addEventListener(Event.ENTER_FRAME,xEnterFrame);
}
private function xEnterFrame(evt:Event):void{
number+=2;
var pi:Number=number* Math.PI/180
//var square:square=new square();
var square:Sprite = new Sprite();
square.graphics.beginFill(0x99CC00);
square.graphics.drawRect(0, 0,20, 90);
addChild(square);
var filter:BlurFilter=new BlurFilter;
filter.blurX=filter.blurY=10;
square.filters=[filter];
//trace(Math.sin(pi)*200+100)
square.x=Math.sin(pi)*180+200;
square.y=Math.cos(pi*1.5)*100+150;
//square.scaleX=square.scaleY=square.y/-200
square.scaleY=(1-square.y)/-300
Tweener.addTween(square, { alpha:0 , time:8,onComplete:eraseMC,onCompleteParams:[square] } );
}
private function eraseMC(x:Sprite):void{
removeChild(x);
}
}
}