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


forked from : soundkitchen's sample 2 [diff(15)]

embed

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