notice: Flash editor updated! Join the development! Thanks to MiniBuilder


forked from : soundkitchen's sample 3 [diff(13)]

embed

FORKED
  1. // forked from soundkitchen's sample 4
  2. package
  3. {
  4.     import flash.display.Sprite;
  5.     import flash.events.MouseEvent;
  6.     import caurina.transitions.Tweener;
  7.     [SWF(width=465, height=465, frameRate=30, backgroundColor=0xffffff)]
  8.     public class Sample extends Sprite
  9.     {  
  10.     
  11.         public function Sample()
  12.         {
  13.             //  オブジェクトを作成
  14.             var ball:Sprite = new Sprite(); 
  15.             //  座標を指定
  16.             ball.x = 100;
  17.             ball.y = 100;
  18.             //  丸を描画
  19.             ball.graphics.beginFill(0x000000);
  20.             ball.graphics.drawCircle(0040);
  21.             ball.graphics.endFill();
  22.             //  クリックイベントにリスナーを登録
  23.             ball.addEventListener(MouseEvent.CLICK, ballClickHandler);
  24.             //  マウスカーソルが指になるように指定
  25.             ball.buttonMode = true;
  26.             //  ステージに配置
  27.             addChild(ball);
  28.             //  トゥイーンさせる
  29.             Tweener.addTween(ball, {
  30.                 x: 300,
  31.                 scaleX: 0,
  32.                 scaleY: 0,
  33.                 time: 2,
  34.                 transition: "easeInOutSine",
  35.                 onComplete: tweenCompleteHandler,
  36.                 onCompleteParams: [ball]
  37.             });
  38.         }
  39.         private function tweenCompleteHandler(ball:Sprite):void
  40.         {
  41.             //  2 回目のトゥイーン
  42.             Tweener.addTween(ball, {
  43.                 y: 300,
  44.                 scaleX: 2,
  45.                 scaleY: 2,
  46.                 time: 1,
  47.                 transition: "easeInExpo"
  48.             });
  49.         }
  50.         private function ballClickHandler(evt:MouseEvent):void
  51.         {
  52.             //  トゥイーンを止める
  53.             Tweener.removeTweens(evt.target);
  54.         }
  55.     }
  56. }
noswf
  1. // forked from soundkitchen's sample 4
  2. package
  3. {
  4.     import flash.display.Sprite;
  5.     import flash.events.MouseEvent;
  6.     import caurina.transitions.Tweener;
  7.     [SWF(width=465, height=465, frameRate=30, backgroundColor=0xffffff)]
  8.     public class Sample extends Sprite
  9.     {
  10.         public function Sample()
  11.         {
  12.             //  オブジェクトを作成
  13.             var ball:Sprite = new Sprite();
  14.             //  座標を指定
  15.             ball.x = 100;
  16.             ball.y = 100;
  17.             //  丸を描画
  18.             ball.graphics.beginFill(0x000000);
  19.             ball.graphics.drawCircle(0040);
  20.             ball.graphics.endFill();
  21.             //  クリックイベントにリスナーを登録
  22.             ball.addEventListener(MouseEvent.CLICK, ballClickHandler);
  23.             //  マウスカーソルが指になるように指定
  24.             ball.buttonMode = true;
  25.             //  ステージに配置
  26.             addChild(ball);
  27.             //  トゥイーンさせる
  28.             Tweener.addTween(ball, {
  29.                 x: 300,
  30.                 scaleX: 0,
  31.                 scaleY: 0,
  32.                 time: 10,
  33.                 transition: "easeInOutSine",
  34.                 onComplete: tweenCompleteHandler,
  35.                 onCompleteParams: [ball]
  36.             });
  37.         }
  38.         private function tweenCompleteHandler(ball:Sprite):void
  39.         {
  40.             //  2 回目のトゥイーン
  41.             Tweener.addTween(ball, {
  42.                 y: 300,
  43.                 scaleX: 2,
  44.                 scaleY: 2,
  45.                 time: 1,
  46.                 transition: "easeInExpo"
  47.             });
  48.         }
  49.         private function ballClickHandler(evt:MouseEvent):void
  50.         {
  51.             //  トゥイーンを止める
  52.             Tweener.removeTweens(evt.target);
  53.         }
  54.     }
  55. }
noswf
Get Adobe Flash Player