| <?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import caurina.transitions.Tweener;
private var _x:int = 0;
private var _y:int = 0;
// 回転しながら左下
private function Act1():void {
_x = img.x;
_y = img.y;
Tweener.addTween(img, {
onComplete:Act2,
x: _x-200,
y: _y+100,
delay: 0.2,
rotation: 360,
transition:'easeInOutQuart',
time:1
});
}
// 回転しながら右下
private function Act2():void {
Tweener.addTween(img, {
onComplete:Act3,
x: _x,
y: _y+200,
delay: 0,
rotation: 360,
transition:'easeInOutQuart',
time:1
});
}
// 回転しながら右上
private function Act3():void {
Tweener.addTween(img, {
onComplete:Act4,
x: _x+200,
y: _y+100,
delay: 0,
rotation: 360,
transition:'easeInOutQuart',
time:1
});
}
// 消えていく
private function Act4():void {
Tweener.addTween(img, {
onComplete:reset,
alpha:0,
time:0.7
});
}
// 出現しながらすばやく元の位置へ
private function reset():void {
Tweener.addTween(img, {
alpha:1,
x: _x,
y: _y,
transition:'easeInBack',
time:0.5
});
}
]]>
</mx:Script>
<mx:VBox>
<mx:Button
click="Act1();"
label="Tweener実行"
/>
</mx:VBox>
<mx:Image id="img" source="http://winofsql.jp/image/winofsql2.png"/>
</mx:Application>
| |