ページ

2010年6月16日水曜日

マウスオーバーとマウスアウト
maru.addEventListener(MouseEvent.ROLL_OVER, onRollover);
maru.addEventListener(MouseEvent.ROLL_OUT, onRollout);

function onRollover(e:MouseEvent):void {
var target_mc:MovieClip = e.target as MovieClip;
target_mc.scaleX=target_mc.scaleY=2.0;
}
function onRollout(e:MouseEvent):void {
var target_mc:MovieClip = e.target as MovieClip;
target_mc.scaleX=target_mc.scaleY=1.0;
}

tweenクラスを使ったアニメーション
import fl.transitions.Tween;
import fl.transitions.easing.Elastic;
import fl.transitions.TweenEvent;

var tObj1:Tween;
var tObj2: Tween;
var tObj3: Tween;

tObj1 = new Tween(maru1, "x" ,Elastic.easeInOut,-150,275,2,true);
tObj1.addEventListener(TweenEvent.MOTION_FINISH, move1);

function move1(e:TweenEvent):void{
tObj2 = new Tween(maru1, "scaleX", Elastic.easeOut,0.2,1,1,true);
tObj3 = new Tween(maru1, "scaleY", Elastic.easeOut,0.2,1,1,true);

}

0 件のコメント:

コメントを投稿