forked from: flash on 2010-5-8
forked from flash on 2010-5-8 (diff: 28)
ActionScript3 source code
/**
* Copyright yasu ( http://wonderfl.net/user/yasu )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/1ond
*/
// forked from yasu's flash on 2010-5-8
package {
import flash.display.*;
import caurina.transitions.Tweener;
import flash.events.MouseEvent;
[SWF( backgroundColor='0xFFFFFF', width='300', frameRate='30')]
public class Tweener_Test extends Sprite {
public function Tweener_Test() {
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
init();
}
private function init():void{
//まずSprite型のBoxを作る
var Box:Sprite = new Sprite();
Box.graphics.beginFill(0x000000);
Box.graphics.drawRect(0,0,50,50);
Box.graphics.endFill();
//ステージにBoxを配置
addChild(Box);
//Tweenerのアニメーション設定
Box.addEventListener(MouseEvent.CLICK,function():void{
//Boxがクリックされたら、X座標250に2秒間で移動
Tweener.addTween(Box, {x:250,time:2,transition:"linear"});
});
}
}
}
