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


embed

FORKED
  1. // forked from soundkitchen's sample 5
  2. package
  3. {
  4.     import flash.display.Sprite;
  5.     import flash.events.MouseEvent;
  6.     import flash.filters.DropShadowFilter;
  7.     import caurina.transitions.Tweener;
  8.     import caurina.transitions.properties.FilterShortcuts;
  9.     [SWF(width=465, height=465, frameRate=30, backgroundColor=0xFFFFFF)]
  10.     public class Sample extends Sprite
  11.     {
  12.         public static const STD_POINT:Number = 150;
  13.         public static const STD_DISTANCE:Number = 32;
  14.         public static const STD_BLUR:Number = 32;
  15.         private var light:Sprite;
  16.         private var ball:Sprite;
  17.         public function Sample():void
  18.         {
  19.             //  FilterShortcuts を有効化
  20.             FilterShortcuts.init();
  21.             //  light を作成
  22.             light = new Sprite();
  23.             light.x = stage.stageWidth / 2;
  24.             light.y = stage.stageHeight / 2;
  25.             light.graphics.beginFill(0xFF0000);
  26.             light.graphics.drawCircle(0020);
  27.             light.graphics.endFill();
  28.             addChild(light);
  29.             //  ball を作成
  30.             ball = new Sprite();
  31.             ball.x = light.x;
  32.             ball.y = light.y;
  33.             ball.filters = [new DropShadowFilter(000, .500)];
  34.             ball.graphics.beginFill(0);
  35.             ball.graphics.drawCircle(0020);
  36.             ball.graphics.endFill();
  37.             addChild(ball);
  38.             //  stage のクリックイベントにリスナーを登録
  39.             stage.addEventListener(MouseEvent.CLICK, clickHandler);
  40.         }
  41.         private function clickHandler(evt:MouseEvent):void
  42.         {
  43.             var dx:Number = mouseX - light.x;
  44.             var dy:Number = mouseY - light.y;
  45.             var dp:Number = Math.sqrt(dx*dx + dy*dy) / STD_POINT;
  46.             var degrees:Number = Math.atan2(dy, dx) / Math.PI * 180;
  47.             Tweener.addTween(ball, {
  48.                 x: mouseX,
  49.                 y: mouseY,
  50.                 _DropShadow_angle: degrees,
  51.                 _DropShadow_distance: dp * STD_DISTANCE,
  52.                 _DropShadow_blurX: dp * STD_BLUR,
  53.                 _DropShadow_blurY: dp * STD_BLUR,
  54.                 time: 1,
  55.                 transition: "easeInOutCubic"
  56.             });
  57.         }
  58.     }
  59. }
noswf
  1. // forked from soundkitchen's sample 5
  2. package
  3. {
  4.     import flash.display.Sprite;
  5.     import flash.events.MouseEvent;
  6.     import flash.filters.DropShadowFilter;
  7.     import caurina.transitions.Tweener;
  8.     import caurina.transitions.properties.FilterShortcuts;
  9.     [SWF(width=465, height=465, frameRate=30, backgroundColor=0xFFFFFF)]
  10.     public class Sample extends Sprite
  11.     {
  12.         public static const STD_POINT:Number = 150;
  13.         public static const STD_DISTANCE:Number = 32;
  14.         public static const STD_BLUR:Number = 32;
  15.         private var light:Sprite;
  16.         private var ball:Sprite;
  17.         public function Sample():void
  18.         {
  19.             //  FilterShortcuts を有効化
  20.             FilterShortcuts.init();
  21.             //  light を作成
  22.             light = new Sprite();
  23.             light.x = stage.stageWidth / 2;
  24.             light.y = stage.stageHeight / 2;
  25.             light.graphics.beginFill(0xFF0000);
  26.             light.graphics.drawCircle(0020);
  27.             light.graphics.endFill();
  28.             addChild(light);
  29.             //  ball を作成
  30.             ball = new Sprite();
  31.             ball.x = light.x;
  32.             ball.y = light.y;
  33.             ball.filters = [new DropShadowFilter(010, .400)];
  34.             ball.graphics.beginFill(0);
  35.             ball.graphics.drawCircle(0020);
  36.             ball.graphics.endFill();
  37.             addChild(ball);
  38.             //  stage のクリックイベントにリスナーを登録
  39.             stage.addEventListener(MouseEvent.CLICK, clickHandler);
  40.         }
  41.         private function clickHandler(evt:MouseEvent):void
  42.         {
  43.             var dx:Number = mouseX - light.x;
  44.             var dy:Number = mouseY - light.y;
  45.             var dp:Number = Math.sqrt(dx*dx + dy*dy) / STD_POINT;
  46.             var degrees:Number = Math.atan2(dy, dx) / Math.PI * 180;
  47.             Tweener.addTween(ball, {
  48.                 x: mouseX,
  49.                 y: mouseY,
  50.                 _DropShadow_angle: degrees,//シャドウの長さ
  51.                 _DropShadow_distance: dp * STD_DISTANCE,
  52.                 _DropShadow_blurX: dp * STD_BLUR,
  53.                 _DropShadow_blurY: dp * STD_BLUR,
  54.                 time: 1,
  55.                 transition: "easeInOutCubic"
  56.             });
  57.         }
  58.     }
  59. }
noswf
  1. // forked from soundkitchen's sample 5
  2. package
  3. {
  4.     import flash.display.Sprite;
  5.     import flash.events.MouseEvent;
  6.     import flash.filters.DropShadowFilter;
  7.     import caurina.transitions.Tweener;
  8.     import caurina.transitions.properties.FilterShortcuts;
  9.     [SWF(width=465, height=465, frameRate=30, backgroundColor=0xFFFFFF)]
  10.     public class Sample extends Sprite
  11.     {
  12.         public static const STD_POINT:Number = 150;
  13.         public static const STD_DISTANCE:Number = 32;
  14.         public static const STD_BLUR:Number = 32;
  15.         private var light:Sprite;
  16.         private var ball:Sprite;
  17.         public function Sample():void
  18.         {
  19.             //  FilterShortcuts を有効化
  20.             FilterShortcuts.init();
  21.             //  light を作成
  22.             light = new Sprite();
  23.             light.x = stage.stageWidth / 2;
  24.             light.y = stage.stageHeight / 2;
  25.             light.graphics.beginFill(0xFF0000);
  26.             light.graphics.drawCircle(0020);
  27.             light.graphics.endFill();
  28.             addChild(light);
  29.             //  ball を作成
  30.             ball = new Sprite();
  31.             ball.x = light.x;
  32.             ball.y = light.y;
  33.             ball.filters = [new DropShadowFilter(000, .500)];
  34.             ball.graphics.beginFill(0);
  35.             ball.graphics.drawCircle(0020);
  36.             ball.graphics.endFill();
  37.             addChild(ball);
  38.             //  stage のクリックイベントにリスナーを登録
  39.             stage.addEventListener(MouseEvent.CLICK, clickHandler);
  40.         }
  41.         private function clickHandler(evt:MouseEvent):void
  42.         {
  43.             var dx:Number = mouseX - light.x;
  44.             var dy:Number = mouseY - light.y;
  45.             var dp:Number = Math.sqrt(dx*dx + dy*dy) / STD_POINT;
  46.             var degrees:Number = Math.atan2(dy, dx) / Math.PI * 180;
  47.             Tweener.addTween(ball, {
  48.                 x: mouseX,
  49.                 y: mouseY,
  50.                 _DropShadow_angle: degrees,
  51.                 _DropShadow_distance: dp * STD_DISTANCE,
  52.                 _DropShadow_blurX: dp * STD_BLUR,
  53.                 _DropShadow_blurY: dp * STD_BLUR,
  54.                 time: 1,
  55.                 transition: "easeInOutCubic"
  56.             });
  57.         }
  58.     }
  59. }
noswf
  1. // forked from soundkitchen's sample 5
  2. package
  3. {
  4.     import flash.display.Sprite;
  5.     import flash.events.MouseEvent;
  6.     import flash.filters.DropShadowFilter;
  7.     import caurina.transitions.Tweener;
  8.     import caurina.transitions.properties.FilterShortcuts;
  9.     [SWF(width=465, height=465, frameRate=30, backgroundColor=0xFFFFFF)]
  10.     public class Sample extends Sprite
  11.     {
  12.         public static const STD_POINT:Number = 150;
  13.         public static const STD_DISTANCE:Number = 32;
  14.         public static const STD_BLUR:Number = 32;
  15.         private var light:Sprite;
  16.         private var ball:Sprite;
  17.         public function Sample():void
  18.         {
  19.             //  FilterShortcuts を有効化
  20.             FilterShortcuts.init();
  21.             //  light を作成
  22.             light = new Sprite();
  23.             light.x = stage.stageWidth / 2;
  24.             light.y = stage.stageHeight / 2;
  25.             light.graphics.beginFill(0xFF0000);
  26.             light.graphics.drawCircle(0020);
  27.             light.graphics.endFill();
  28.             addChild(light);
  29.             //  ball を作成
  30.             ball = new Sprite();
  31.             ball.x = light.x;
  32.             ball.y = light.y;
  33.             ball.filters = [new DropShadowFilter(0000.500)];
  34.             ball.graphics.beginFill(0);
  35.             ball.graphics.drawCircle(0020);
  36.             ball.graphics.endFill();
  37.             addChild(ball);
  38.             //  stage のクリックイベントにリスナーを登録
  39.             stage.addEventListener(MouseEvent.CLICK, clickHandler);
  40.         }
  41.         private function clickHandler(evt:MouseEvent):void
  42.         {
  43.             var dx:Number = mouseX - light.x;
  44.             var dy:Number = mouseY - light.y;
  45.             var dp:Number = Math.sqrt(dx*dx + dy*dy) / STD_POINT;
  46.             var degrees:Number = Math.atan2(dy, dx) / Math.PI * 180;
  47.             Tweener.addTween(ball, {
  48.                 x: mouseX,
  49.                 y: mouseY,
  50.                 _DropShadow_angle: degrees,
  51.                 _DropShadow_distance: dp * STD_DISTANCE,
  52.                 _DropShadow_blurX: dp * STD_BLUR,
  53.                 _DropShadow_blurY: dp * STD_BLUR,
  54.                 time: 1,
  55.                 transition: "easeInOutCubic"
  56.             });
  57.         }
  58.     }
  59. }
noswf
Get Adobe Flash Player