Takahiro Abe

挑戦者の皆様、ご参加いただきありがとうございました!
今回の CHECKMATE のお題を決定するにあたって「コンテンツと技術のバランス」について考えました。
ともすると技術というのは、スピードやパフォーマンスなどの量的な指標や、最適化の手法に囚われがちです。
ですが、面白いコンテンツを作ることと、技術の限界に挑戦することは必ずしもベクトルが同じとは限りません。
そういう意味では「参加者がお題に挑戦!」というよりも、むしろ「出題者の挑戦を手助けしてもらう」という変則的な内容になってしまっていたかなと思います。
しかし、そういった厄介なお題にもかかわらず様々な方にご参加頂き、多くのインスピレーションをいただきました。
この機会がよりよい Flash 文化の発展に寄与できれば幸いです。

Thank you for your participation!
To bring this challenge, I considered about "balance between content and technique."
We tend to pursue measurable and tangible result, such as speed and performance. But creating good content is nothing to do with them in many case.
From this point of view, it was challenge for me, helped by participants, rather than challenge for participants.
Though these were irregular challenges, I was happy and to have many participation and you gave me lots of inspiration.
I hope this case could help improving Flash Community.

Professional

  1. Queen
    izm_design
  2. Bishop
    yd_niku
  3. Knight
    該当者なし Not corresponding

View All Other Challengers

Amateur

Queenk3lab

  1. // forked from checkmate's Progression4 Amateur
  2. package {
  3.     /*
  4.      * 左上の顔パーツを適当に動かすと、顔の球のマテリアル内でもパーツが動きます。
  5.      * 
  6.      *
  7.      * 
  8.      */
  9.     import flash.display.*;
  10.     import flash.events.*;
  11.     import flash.geom.Rectangle;
  12.     import flash.geom.Matrix;
  13.     import flash.utils.getTimer;
  14.     import flash.net.URLRequest
  15.     import frocessing.color.ColorHSV;
  16.     import jp.progression.casts.*;
  17.     import jp.progression.commands.*;
  18.     import jp.progression.commands.lists.*;
  19.     import jp.progression.commands.net.*;
  20.     import jp.progression.config.*;
  21.     import jp.progression.data.*;
  22.     import jp.progression.events.*;
  23.     import jp.progression.scenes.*;
  24.     import jp.progression.*;
  25.     //
  26.     [SWF(width="465", height="465", frameRate="30")]
  27.     public class Amateur extends Sprite {
  28.         public var manager:Progression, self:Amateur;
  29.         // Graphics
  30.         public var face:MovieClip;
  31.         public var hair:MovieClip;
  32.         public var eyeBrowLeft:MovieClip, eyeBrowRight:MovieClip;
  33.         public var eyeLeft:MovieClip, eyeRight:MovieClip;
  34.         public var nose:MovieClip;
  35.         public var mouth:MovieClip;
  36.         //
  37.         private var _hsv:ColorHSV;
  38.         private var _sp:Sprite;
  39.         private var _w:Number;
  40.         private var _h:Number;
  41.         private var _bmp:Bitmap;
  42.         private var _bmpData:BitmapData;
  43.         private var _Array:Array = [];
  44.         //*****************************
  45.         // Do Something
  46.         public function atReady():void {
  47.             //背景画像
  48.             addChild(new CastBitmap(getResourceById(CheckmateBuilder.BG_URL).data)); 
  49.             //
  50.             _hsv = new ColorHSV();
  51.             //
  52.             _sp = addChild(new Sprite()) as Sprite;
  53.             _sp.x = _sp.y = -35;
  54.             for (var n:int = 0; n < 15; n++) {
  55.                 for (var j:int = 0; j < 15; j++) {
  56.                     var par:Sprite = _sp.addChild(new Sprite()) as Sprite;
  57.                     par.graphics.beginFill(0xFFFFFF);
  58.                     par.graphics.drawRect(001010);
  59.                     par.graphics.endFill()
  60.                     par.x = par.width * n;
  61.                     par.y = par.width * j;
  62.                     _Array.push(par);
  63.                 }
  64.             }
  65.             //**************************************
  66.             //顔の球を作成
  67.             var sphere:Spheres = addChild(new Spheres(_sp)) as Spheres;
  68.             sphere.y = 20;
  69.             
  70.             //**************************************
  71.             //パーツ類の設定
  72.             mouth.scaleX = mouth.scaleY = 0.4;
  73.             nose.scaleX = nose.scaleY = 0.4;
  74.             eyeRight.scaleX = eyeRight.scaleY = 0.4;
  75.             eyeLeft.scaleX = eyeLeft.scaleY = 0.45;
  76.             eyeBrowLeft.scaleX = eyeBrowLeft.scaleY = 0.4;
  77.             eyeBrowRight.scaleX = eyeBrowRight.scaleY = 0.4;
  78.             
  79.             nose.addEventListener(MouseEvent.MOUSE_DOWN, _drag);
  80.             mouth.addEventListener(MouseEvent.MOUSE_DOWN, _drag);
  81.             eyeRight.addEventListener(MouseEvent.MOUSE_DOWN, _drag);
  82.             eyeLeft.addEventListener(MouseEvent.MOUSE_DOWN, _drag);
  83.             eyeBrowRight.addEventListener(MouseEvent.MOUSE_DOWN, _drag);
  84.             eyeBrowLeft.addEventListener(MouseEvent.MOUSE_DOWN, _drag);
  85.             
  86.             _sp.addChild( mouth );
  87.             _sp.addChild( nose );
  88.             _sp.addChild( eyeLeft );
  89.             _sp.addChild( eyeRight );
  90.             _sp.addChild( eyeBrowLeft );
  91.             _sp.addChild( eyeBrowRight );
  92.             
  93.             //**************************************
  94.             //髪の毛のモザイク
  95.             var bmpData:BitmapData = new BitmapData(1,1);
  96.             _bmp = new Bitmap(bmpData);
  97.             addChild(_bmp);
  98.             _w = hair.width * 2;
  99.             _h = hair.height * 2;
  100.             _bmp.x = 30;
  101.             _bmp.y = -10;
  102.             setMosaic( hair );
  103.             //**************************************
  104.             //
  105.             stage.addEventListener( MouseEvent.MOUSE_UP, _up );
  106.             addEventListener(Event.ENTER_FRAME, loop );
  107.             
  108.         }
  109.         private function loop(e:Event):void {
  110.             _hsv.h = ++_hsv.h % 360;
  111.             for each(var mc:Sprite in _Array) {
  112.                 mc.alpha = Math.sin(getTimer()  * Math.random() * 100) + 1.4;
  113.                 mc.graphics.clear();
  114.                 mc.graphics.beginFill(_hsv.value);
  115.                 mc.graphics.drawRect(001010);
  116.                 mc.graphics.endFill();
  117.             }
  118.         }
  119.         private function _drag(e:MouseEvent):void {
  120.             e.target.startDrag(false,new Rectangle(40,0,100,140));
  121.         }
  122.         private function _up(e:MouseEvent):void {
  123.             stopDrag();
  124.         }
  125.         //髪の毛のモザイク処理
  126.         public function setMosaic(mc:Sprite):void { 
  127.             var Mtx:Matrix = new Matrix(); 
  128.             var scaleNum:uint = 10;
  129.             Mtx.scale( 1 / scaleNum, 1 / scaleNum );
  130.             Mtx.translate( 2020);
  131.             _bmpData = new BitmapData( _w/scaleNum, _h/scaleNum, true, 0x000000 ); 
  132.             _bmpData.draw( mc, Mtx ); 
  133.             _bmp.bitmapData = _bmpData; 
  134.             _bmp.scaleX = _w/_bmpData.width; 
  135.             _bmp.scaleY = _h/_bmpData.height; 
  136.         }
  137.         public function Amateur() {
  138.             CheckmateBuilder.initialize( this );
  139.         }
  140.     }
  141. }
  142. import org.papervision3d.core.proto.LightObject3D;
  143. import org.papervision3d.materials.ColorMaterial;
  144. import org.papervision3d.materials.MovieMaterial;
  145. import org.papervision3d.materials.shaders.PhongShader;
  146. import org.papervision3d.materials.shaders.ShadedMaterial;
  147. import org.papervision3d.view.BasicView;
  148. import org.papervision3d.objects.primitives.Sphere
  149. import org.papervision3d.materials.shaders.FlatShader
  150. class Spheres extends BasicView {
  151.     private var _movie:Sprite;
  152.     public function Spheres(movie:Sprite) {
  153.         super(465465truetrue);
  154.         _movie = movie;
  155.         init();
  156.     }
  157.     public function init():void {
  158.         //カメラの設定
  159.         camera.focus = 100;
  160.         camera.zoom = 11;
  161.         //ライトを作成
  162.         var light:LightObject3D = new LightObject3D();
  163.         // マテリアルを作成
  164.         var tesst:MovieMaterial = new MovieMaterial(_movie, truetruetrue);
  165.         // シェイダーを作成 
  166.         var shader:FlatShader = new FlatShader(light, 0xFFFFFF, 0);
  167.         // シェイダーを適用したマテリアルを作成 
  168.         var shadedMaterial:ShadedMaterial = new ShadedMaterial(tesst, shader);
  169.         // 球を作成
  170.         var sphere:Sphere = new Sphere(shadedMaterial, 100,25,25)
  171.         sphere.scaleY = 1.5;
  172.         //
  173.         scene.addChild(sphere);
  174.         addEventListener(Event.ENTER_FRAME, function(e:Event):void {
  175.             light.copyPosition(camera) 
  176.             sphere.yaw(1);
  177.         })
  178.         startRendering();
  179.     }    
  180. }
  181. import flash.display.*;
  182. import flash.events.*;
  183. import flash.net.URLRequest;
  184. import flash.system.LoaderContext;
  185. import flash.system.ApplicationDomain;
  186. import jp.progression.casts.*;
  187. import jp.progression.commands.*;
  188. import jp.progression.commands.lists.*;
  189. import jp.progression.commands.net.*;
  190. import jp.progression.config.*;
  191. import jp.progression.data.*;
  192. import jp.progression.events.*;
  193. import jp.progression.scenes.*;
  194. import jp.progression.*;
  195. class CheckmateBuilder extends EventDispatcher {
  196.        public static var GRAPHICS_URL:String = "http://swf.wonderfl.net/static/assets/checkmate04/AmateurAssets.swf";
  197.     public static var BG_URL:String = "http://www.k3lab.com/wonderfl/diginium/bg.jpg";
  198.     private static var _target:Amateur;
  199.     private static var _manager:Progression;
  200.     public static function initialize( target:Amateur ):void {
  201.         if ( _target ) { return; }
  202.         _target = target;
  203.         _target.self = target;
  204.         Progression.initialize( new BasicAppConfig() );
  205.         _manager = new Progression( "index", _target.stage );
  206.         _manager.root.addEventListener( SceneEvent.SCENE_LOAD, _sceneLoad );
  207.         _manager.root.addEventListener( SceneEvent.SCENE_INIT_COMPLETE, _sceneInitComplete );
  208.         _manager.goto( _manager.root.sceneId );
  209.     }
  210.     private static function _sceneLoad( e:SceneEvent ):void {
  211.         _manager.root.addCommand(
  212.             new LoadSWF( new URLRequest( GRAPHICS_URL ) ),
  213.             function():void {
  214.                 var loader:Loader = Loader( this.latestData );
  215.                 var domain:ApplicationDomain = loader.contentLoaderInfo.applicationDomain;
  216.                 _target.hair = new ( domain.getDefinition( "Hair" ) as Class );
  217.                 _target.hair.x = 233;
  218.                 _target.hair.y = 194;
  219.                 _target.eyeBrowRight = new ( domain.getDefinition( "EyeBrowRight" ) as Class );
  220.                 _target.eyeBrowRight.x = 72;
  221.                 _target.eyeBrowRight.y = 70;
  222.                 _target.eyeBrowLeft = new ( domain.getDefinition( "EyeBrowLeft" ) as Class );
  223.                 _target.eyeBrowLeft.x = 100;
  224.                 _target.eyeBrowLeft.y = 70;
  225.                 _target.eyeRight = new ( domain.getDefinition( "EyeRight" ) as Class );
  226.                 _target.eyeRight.x = 73;
  227.                 _target.eyeRight.y = 80;
  228.                 _target.eyeLeft = new ( domain.getDefinition( "EyeLeft" ) as Class );
  229.                 _target.eyeLeft.x = 97;
  230.                 _target.eyeLeft.y = 79;
  231.                 _target.nose = new ( domain.getDefinition( "Nose" ) as Class );
  232.                 _target.nose.x = 86;
  233.                 _target.nose.y = 85;
  234.                 _target.mouth = new ( domain.getDefinition( "Mouth" ) as Class );
  235.                 _target.mouth.x = 88
  236.                 _target.mouth.y = 100;
  237.             },
  238.             new LoadBitmapData(new URLRequest(BG_URL), {context:new LoaderContext(true)})
  239.         );
  240.     }
  241.      
  242.     private static function _sceneInitComplete( e:SceneEvent ):void {
  243.         _target.atReady();
  244.     }
  245. }
flash swf thumbnail play
出題者からのコメント
顔を回転させている状態で編集させることで、結果の分からない意外性から生まれる表情がとても気持ち悪くて面白いですね!
Comments from King
Result is unpredictable because of editing face while its rounding. Weird and interesting face shows up!

Bishopbuccchi

  1. // forked from checkmate's Progression4 Amateur
  2. /*
  3.  * 顔時計
  4.  *  時:顔色
  5.  *  分:顔の角度
  6.  *  秒:髪の角度
  7.  *
  8.  * 1分に1度、ハンサム顔になります。
  9.  */
  10. package {
  11.     import flash.display.*;
  12.     import flash.events.*;
  13.     import jp.progression.casts.*;
  14.     import jp.progression.commands.*;
  15.     import jp.progression.commands.lists.*;
  16.     import jp.progression.commands.net.*;
  17.     import jp.progression.config.*;
  18.     import jp.progression.data.*;
  19.     import jp.progression.events.*;
  20.     import jp.progression.scenes.*;
  21.     import jp.progression.*;
  22.     
  23.     import flash.display.BitmapData;
  24.     import flash.display.Bitmap;
  25.     import flash.geom.Matrix;
  26.     import flash.geom.Rectangle;
  27.     import flash.utils.Timer;
  28.     import flash.events.TimerEvent;
  29.     
  30.     import org.libspark.betweenas3.BetweenAS3;
  31.     import org.libspark.betweenas3.easing.*;
  32.     
  33.     //import net.hires.debug.Stats;
  34.     [SWF( width=465, height=465, backgroundColor=0xFFFFFF, frameRate=30 )]
  35.     public class Amateur extends Sprite {
  36.         private const WIDTH:Number = 465;
  37.         private const HEIGHT:Number = 465;
  38.         
  39.         public var manager:Progression, self:Amateur;
  40.         // Graphics
  41.         public var face:MovieClip;
  42.         public var hair:MovieClip;
  43.         public var eyeBrowLeft:MovieClip, eyeBrowRight:MovieClip;
  44.         public var eyeLeft:MovieClip, eyeRight:MovieClip;
  45.         public var nose:MovieClip;
  46.         public var mouth:MovieClip;
  47.         private var _status:Array;
  48.         
  49.         private var _head:Sprite;
  50.         private var _face:FaceSprite;
  51.         private var _hairL:Sprite;
  52.         private var _hairR:Sprite;
  53.         private var _hairStatus:Array;
  54.         private var _faceChilds:Array;
  55.         private var _nowSeconds:Number;
  56.         
  57.         // Do Something
  58.         public function atReady():void {
  59.             //メモリ使用量表示
  60.             //addChild(new Stats());
  61.             
  62.             //文字盤生成
  63.             var disk:ClockDisk = new ClockDisk();
  64.             disk.x = WIDTH/2;
  65.             disk.y = HEIGHT/2;
  66.             addChild( disk );
  67.             
  68.             //顔生成
  69.             _face = new FaceSprite( face );
  70.             
  71.             //すべてのパーツを原点移動
  72.             var difX:Number = _face.x;
  73.             var difY:Number = _face.y;
  74.             var parts:Array = [_face, hair, mouth, nose, eyeLeft, eyeRight, eyeBrowLeft, eyeBrowRight];
  75.             for each(var c:DisplayObject in parts) {
  76.                 c.x -= difX; 
  77.                 c.y -= difY; 
  78.             }
  79.             
  80.             //hairの移動情報
  81.             var hX:Number = hair.x;
  82.             var hY:Number = hair.y;
  83.             _hairStatus =     [{angle:0,   x:hX,    y:hY,     sX:1,  sY:1,  d:"LR"},
  84.                              {angle:49,  x:hX+5,  y:hY,     sX:1,  sY:1,  d:"LR"},
  85.                              {angle:50,  x:hX+5,  y:hY,     sX:1,  sY:1,  d:"R"},
  86.                              {angle:144, x:hX+10, y:hY,     sX:1,  sY:1,  d:"R"},
  87.                              {angle:145, x:hX+10, y:hY,     sX:1,  sY:1,  d:"FACE"},
  88.                              {angle:164, x:hX+5,  y:hY,     sX:1,  sY:1,  d:"FACE"},
  89.                              //ヒゲ
  90.                              {angle:165, x:hX+5,  y:hY+170, sX:.5, sY:.3, d:"LR"},
  91.                              {angle:180, x:hX,    y:hY+175, sX:.5, sY:.3, d:"LR"},
  92.                              {angle:200, x:hX-5,  y:hY+170, sX:.5, sY:.3, d:"LR"},
  93.                              //
  94.                              {angle:201, x:hX-15, y:hY,     sX:1,  sY:1,  d:"FACE"},
  95.                              {angle:250, x:hX-15, y:hY,     sX:1,  sY:1,  d:"FACE"},
  96.                              {angle:251, x:hX-15, y:hY,     sX:1,  sY:1,  d:"L"},
  97.                              {angle:320, x:hX-5,  y:hY,     sX:1,  sY:1,  d:"L"},
  98.                              {angle:321, x:hX-5,  y:hY,     sX:1,  sY:1,  d:"LR"},
  99.                              {angle:360, x:hX,    y:hY,     sX:1,  sY:1,  d:"LR"}];
  100.             
  101.             
  102.             //heirを左右に分割
  103.             //中心点
  104.             var pivotX:Number = 132;
  105.             var pivotY:Number = 119;
  106.             
  107.             //右髪を生成
  108.             _hairR = new Sprite();
  109.             var bmpDataR:BitmapData = new BitmapData(105+1238true, 0x0);
  110.             bmpDataR.draw(hair, new Matrix(1001, pivotX, pivotY), nullnullnullfalse);
  111.             var bmpR:Bitmap = new Bitmap(bmpDataR);
  112.             bmpR.smoothing = true;
  113.             bmpR.x = -pivotX;
  114.             bmpR.y = -pivotY;
  115.             _hairR.addChild(bmpR);
  116.             
  117.             //左髪を生成
  118.             _hairL = new Sprite();
  119.             var bmpDataL:BitmapData = new BitmapData(159238true, 0x0);
  120.             bmpDataL.draw(hair, new Matrix(1001, pivotX-105, pivotY), nullnullnullfalse);
  121.             var bmpL:Bitmap = new Bitmap(bmpDataL);
  122.             bmpL.smoothing = true;
  123.             bmpL.x = -pivotX+105;
  124.             bmpL.y = -pivotY;
  125.             _hairL.addChild(bmpL);
  126.             
  127.             _hairL.x = _hairR.x = hair.x;
  128.             _hairL.y = _hairR.y = hair.y;
  129.             
  130.             _head = new Sprite();
  131.             _head.x = WIDTH/2;
  132.             _head.y = HEIGHT/2;
  133.             addChild( _head );
  134.             _head.addChild( _face );
  135.             _face.addChild( mouth );
  136.             _face.addChild( nose );
  137.             _face.addChild( eyeLeft );
  138.             _face.addChild( eyeRight );
  139.             _face.addChild( eyeBrowLeft );
  140.             _face.addChild( eyeBrowRight );
  141.             _head.addChild( _hairR );
  142.             _head.addChild( _hairL );
  143.             
  144.             //初期状態を保持
  145.             _faceChilds = [mouth, nose, eyeLeft, eyeRight, eyeBrowLeft, eyeBrowRight];
  146.             _status = [];
  147.             for each(var child:DisplayObject in _faceChilds) {
  148.                 child.x -=  _face.x;
  149.                 child.y -=  _face.y;
  150.                 _status.push( {
  151.                     x:child.x,
  152.                     y:child.y,
  153.                     scaleX:child.scaleX,
  154.                     scaleY:child.scaleY,
  155.                     rotation:child.rotation
  156.                 } );
  157.             }
  158.             addEventListener(Event.ENTER_FRAME, onEnterframe);
  159.         }
  160.         
  161.         private function onEnterframe(e:Event):void {
  162.             var nowDate:Date = new Date();
  163.             if ( _nowSeconds != nowDate.seconds ) {
  164.                 _nowSeconds = nowDate.seconds;
  165.                 var h:Number = nowDate.hours;
  166.                 var m:Number = nowDate.minutes;
  167.                 var s:Number = nowDate.seconds;
  168.                 var hAngle:Number = ((h % 12) * 30) + (m / 2) + (s/120);
  169.                 var mAngle:Number = (m * 6) + (s / 10);
  170.                 var sAngle:Number =  s * 6;
  171.                 
  172.                 updateClock(hAngle, mAngle, sAngle);
  173.                 
  174.                 //髪と顔の角度が同じ(近い)ときはハンサム顔に
  175.                 if(Math.abs(mAngle+1-sAngle)<3){
  176.                     changeHandsomeFace();
  177.                 }else{
  178.                     changeFace();
  179.                 }
  180.             }
  181.         }
  182.         
  183.         private function updateClock(hA:Number=0, mA:Number=0, sA:Number=0):void {
  184.             _face.changeColor( hA );
  185.             _head.rotation = mA;
  186.             var hairAngle:Number = sA-Math.floor(mA);
  187.             if(hairAngle<0){ hairAngle += 360 };
  188.             var i:uint = getHairStatusIndex(hairAngle);
  189.             var range:Number = _hairStatus[i+1].angle - _hairStatus[i].angle;
  190.             var step:Number = hairAngle - _hairStatus[i].angle;
  191.             var rate:Number = range/step;
  192.             var targetX:Number = _hairStatus[i].x + (_hairStatus[i+1].x - _hairStatus[i].x) / rate;
  193.             var targetY:Number = _hairStatus[i].y + (_hairStatus[i+1].y - _hairStatus[i].y) / rate;
  194.             var targetScaleX:Number = _hairStatus[i].sX + (_hairStatus[i+1].sX - _hairStatus[i].sX) / rate;
  195.             var targetScaleY:Number = _hairStatus[i].sY + (_hairStatus[i+1].sY - _hairStatus[i].sY) / rate;
  196.             _hairL.rotation = _hairR.rotation = hairAngle;
  197.             _hairL.x = _hairR.x = targetX;
  198.             _hairL.y = _hairR.y = targetY;
  199.             _hairL.scaleX = _hairR.scaleX = targetScaleX;
  200.             _hairL.scaleY = _hairR.scaleY = targetScaleY;
  201.             
  202.             //深度変更
  203.             switch(_hairStatus[i].d){
  204.                 case "L":
  205.                     _head.setChildIndex(_face, 0);
  206.                     _head.setChildIndex(_hairR, 0);
  207.                     break;
  208.                 case "R":
  209.                     _head.setChildIndex(_face, 0);
  210.                     _head.setChildIndex(_hairL, 0);
  211.                     break;
  212.                 case "LR":
  213.                     _head.setChildIndex(_face, 0);
  214.                     break;
  215.                 default:
  216.                     _head.setChildIndex(_hairL, 0);
  217.                     _head.setChildIndex(_hairR, 0);
  218.             }
  219.         }
  220.         
  221.         private function getHairStatusIndex(hairAngle:Number):uint {
  222.             for(var i:uint=0; i<_hairStatus.length-1; i++){
  223.                 if(hairAngle >= _hairStatus[i].angle && hairAngle < _hairStatus[i+1].angle){
  224.                     return i;
  225.                 }
  226.             }
  227.             return null;
  228.         }
  229.         
  230.         //表情を変える
  231.         private function changeFace():void {
  232.             var baseY:Number = ( Math.random() - .8 ) * 30;
  233.             for ( var i:uint=0; i<_faceChilds.length; i++ ) {
  234.                 var child:DisplayObject = _faceChilds[i];
  235.                 var status:Object = _status[i];
  236.                 BetweenAS3.tween(child, {
  237.                                  x:status.x + ( Math.random() - 0.5 ) * 15,
  238.                                  y:status.y + ( Math.random() - 0.5 ) * 15 + baseY,
  239.                                  scaleX:status.scaleX + ( Math.random() - 0.6 ) / 2,
  240.                                  scaleY:status.scaleY + ( Math.random() - 0.5 ) / 3,
  241.                                  rotation:status.rotation + ( Math.random() - 0.5 ) * 40
  242.                                  }, null, .3, Cubic.easeOut).play();
  243.             }
  244.         }
  245.         
  246.         private function changeHandsomeFace():void {
  247.             for ( var i:uint=0; i<_faceChilds.length; i++ ) {
  248.                 var child:DisplayObject = _faceChilds[i];
  249.                 var status:Object = _status[i];
  250.                 var difY:Number = 0;
  251.                 var difRotation:Number = 0;
  252.                 switch(child){
  253.                     case eyeBrowLeft:
  254.                         difY = 10;
  255.                         difRotation = -10;
  256.                         break;
  257.                     case eyeBrowRight:
  258.                         difY = 10;
  259.                         difRotation = 10;
  260.                         break;
  261.                 }
  262.                 BetweenAS3.tween(child, {
  263.                                  x:status.x,
  264.                                  y:status.y+difY,
  265.                                  scaleX:status.scaleX,
  266.                                  scaleY:status.scaleY,
  267.                                  rotation:status.rotation+difRotation
  268.                                  }, null, .3, Cubic.easeOut).play();
  269.             }
  270.         }
  271.         /*private function _click( e:MouseEvent ):void {
  272.             for ( var i:int = 0, l:int = numChildren; i < l; i++ ) {
  273.                 var child:DisplayObject = getChildAt( i );
  274.                 var status:Object = _status[i];
  275.                 child.x = status.x + ( Math.random() - 0.5 ) * 10;
  276.                 child.y = status.y + ( Math.random() - 0.5 ) * 10;
  277.                 child.scaleX = status.scaleX + ( Math.random() - 0.5 ) / 2;
  278.                 child.scaleY = status.scaleY + ( Math.random() - 0.5 ) / 2;
  279.                 child.rotation = status.rotation + ( Math.random() - 0.5 ) * 10;
  280.             }
  281.         }*/
  282.         
  283.         public function Amateur() {
  284.             CheckmateBuilder.initialize( this );
  285.         }
  286.     }
  287. }
  288. import flash.display.DisplayObject;
  289. import flash.display.Sprite;
  290. import flash.display.MovieClip;
  291. import flash.display.BitmapData;
  292. import flash.display.Bitmap;
  293. import flash.display.BitmapDataChannel;
  294. import flash.geom.Rectangle;
  295. import flash.geom.Point;
  296. import flash.geom.Matrix;
  297. import flash.geom.ColorTransform;
  298. import frocessing.color.FColor;
  299. import frocessing.color.ColorHSV;
  300. class FaceSprite extends Sprite {
  301.     private var _c:ColorHSV;
  302.     private var _hada:Bitmap;
  303.     
  304.     public function FaceSprite(ori:MovieClip) {
  305.         _c = new ColorHSV();
  306.         
  307.         x = ori.x;
  308.         y = ori.y;
  309.         var oriBmd:BitmapData = new BitmapData(ori.width, ori.height, true, 0x00000000);
  310.         oriBmd.draw(ori, new Matrix(1001, ori.width/2, ori.height/2));
  311.         
  312.         //輪郭
  313.         var rinkakuBmd:BitmapData = new BitmapData(ori.width, ori.height, true, 0x00000000);
  314.         rinkakuBmd.copyChannel(oriBmd,  new Rectangle(00, ori.width, ori.height),  new Point(), BitmapDataChannel.ALPHA, BitmapDataChannel.ALPHA);
  315.         var rinkaku:Bitmap = new Bitmap(rinkakuBmd);
  316.         
  317.         //肌色
  318.         var hadaBmd:BitmapData = new BitmapData(ori.width, ori.height, true, 0xFFFFFF00);
  319.         hadaBmd.copyChannel(oriBmd, new Rectangle(00, ori.width, ori.height), new Point(), BitmapDataChannel.RED, BitmapDataChannel.ALPHA);
  320.         _hada = new Bitmap(hadaBmd);
  321.         
  322.         //ハイライト
  323.         var tekariBmd:BitmapData = new BitmapData(ori.width, ori.height, true, 0xFFFFFFFF);
  324.         tekariBmd.copyChannel(oriBmd, new Rectangle(00, ori.width, ori.height),  new Point(), BitmapDataChannel.BLUE, BitmapDataChannel.ALPHA);
  325.         var tekari:Bitmap = new Bitmap(tekariBmd);
  326.         
  327.         addChild( rinkaku );
  328.         addChild( _hada );
  329.         addChild( tekari );
  330.         
  331.         for ( var i:int = 0; i<numChildren; i++ ) {
  332.             var c:DisplayObject = getChildAt(i);
  333.             c.x -= ori.width/2;
  334.             c.y -= ori.height/2;
  335.             Bitmap(c).smoothing = true;
  336.         }
  337.     }
  338.     
  339.     //顔色を変更
  340.     public function changeColor(h:Number):void {
  341.         var rgb:Object = FColor.HSVtoRGB(h, .81);
  342.         var ct:ColorTransform = _hada.transform.colorTransform;
  343.         ct.color = (rgb.r << 16) | (rgb.g << 8) | (rgb.b);
  344.         _hada.transform.colorTransform = ct;
  345.     }
  346. }
  347. class ClockDisk extends Sprite {
  348.     public function ClockDisk() {
  349.         var h:Number = 190;    //半径
  350.         for(var i:uint=0; i<60; i++){
  351.             var angle:Number = i*6;
  352.             var radian:Number = angle*Math.PI/180;
  353.             var rgb:Object = FColor.HSVtoRGB(angle+90, .81);
  354.             var color:Number = (rgb.r << 16) | (rgb.g << 8) | (rgb.b);
  355.             var l:Number;    //線の長さ
  356.             (angle%30 == 0) ? l=12 : l=4;
  357.             graphics.lineStyle(0, color);
  358.             graphics.moveTo(Math.cos(radian)*(h-l), Math.sin(radian)*(h-l));
  359.             graphics.lineTo(Math.cos(radian)*h, Math.sin(radian)*h);
  360.         }
  361.     }
  362. }
  363. import flash.display.*;
  364. import flash.events.*;
  365. import flash.net.URLRequest;
  366. import flash.system.ApplicationDomain;
  367. import jp.progression.casts.*;
  368. import jp.progression.commands.*;
  369. import jp.progression.commands.lists.*;
  370. import jp.progression.commands.net.*;
  371. import jp.progression.config.*;
  372. import jp.progression.data.*;
  373. import jp.progression.events.*;
  374. import jp.progression.scenes.*;
  375. import jp.progression.*;
  376. class CheckmateBuilder extends EventDispatcher {
  377.        public static var GRAPHICS_URL:String = "http://swf.wonderfl.net/static/assets/checkmate04/AmateurAssets.swf";
  378.     private static var _target:Amateur;
  379.     private static var _manager:Progression;
  380.     public static function initialize( target:Amateur ):void {
  381.         if ( _target ) { return; }
  382.         _target = target;
  383.         _target.self = target;
  384.         Progression.initialize( new BasicAppConfig() );
  385.         _manager = new Progression( "index", _target.stage );
  386.         _manager.root.addEventListener( SceneEvent.SCENE_LOAD, _sceneLoad );
  387.         _manager.root.addEventListener( SceneEvent.SCENE_INIT_COMPLETE, _sceneInitComplete );
  388.         _manager.goto( _manager.root.sceneId );
  389.     }
  390.     private static function _sceneLoad( e:SceneEvent ):void {
  391.         _manager.root.addCommand(
  392.             new LoadSWF( new URLRequest( GRAPHICS_URL ) ),
  393.             function():void {
  394.                 var loader:Loader = Loader( this.latestData );
  395.                 var domain:ApplicationDomain = loader.contentLoaderInfo.applicationDomain;
  396.                 _target.face = new ( domain.getDefinition( "Face" ) as Class );
  397.                 _target.face.x = 234;
  398.                 _target.face.y = 242;
  399.                 _target.hair = new ( domain.getDefinition( "Hair" ) as Class );
  400.                 _target.hair.x = 233;
  401.                 _target.hair.y = 194;
  402.                 _target.eyeBrowRight = new ( domain.getDefinition( "EyeBrowRight" ) as Class );
  403.                 _target.eyeBrowRight.x = 190;
  404.                 _target.eyeBrowRight.y = 218;
  405.                 _target.eyeBrowLeft = new ( domain.getDefinition( "EyeBrowLeft" ) as Class );
  406.                 _target.eyeBrowLeft.x = 270;
  407.                 _target.eyeBrowLeft.y = 218;
  408.                 _target.eyeRight = new ( domain.getDefinition( "EyeRight" ) as Class );
  409.                 _target.eyeRight.x = 190;
  410.                 _target.eyeRight.y = 248;
  411.                 _target.eyeLeft = new ( domain.getDefinition( "EyeLeft" ) as Class );
  412.                 _target.eyeLeft.x = 272;
  413.                 _target.eyeLeft.y = 243;
  414.                 _target.nose = new ( domain.getDefinition( "Nose" ) as Class );
  415.                 _target.nose.x = 236;
  416.                 _target.nose.y = 275;
  417.                 _target.mouth = new ( domain.getDefinition( "Mouth" ) as Class );
  418.                 _target.mouth.x = 242;
  419.                 _target.mouth.y = 322;
  420.             }
  421.         );
  422.     }
  423.     private static function _sceneInitComplete( e:SceneEvent ):void {
  424.         _target.atReady();
  425.     }
  426. }
flash swf thumbnail play
出題者からのコメント
某時計コンテンツの「気持ちいいから見続けてしまう」とは逆に、「気持ち悪いから(あるいはもっと気持ち悪くなることを期待して)見続けてしまう」というある種の怖いもの見たさを刺激されました
Comments from King
I kept watching it because it was weird, and anticipated even weirder, in contrast of famous "comfortable" clock content. Some kind of my spirit of inquiry is fully content.

KnightOKASUKE

  1. /*forked from checkmate's Progression4 Amateur
  2. * @OKASUKE
  3. * ゲームバランスは皆無です。運です 無駄にソースが長い・・・試行錯誤中
  4. * 10/18 とりあえずiPhoneやAndroidにも移植できそうな・・・タッチ&リリース
  5. * 10/19 アルファ版 絶対書き方間違ってる!
  6. * 10/20 不具合を修正・点数計算方法(大雑把)を考える。
  7. * 10/21 動きにフィルタをつける予定…いまいちなので中止
  8. * 10/23 完成予定
  9. */
  10. package {
  11. import adobe.utils.CustomActions;
  12. import flash.display.*;
  13. import flash.events.*;
  14. import flash.geom.*;
  15. import flash.text.TextField;
  16. import flash.text.TextFieldType;
  17. import flash.text.TextFormat;
  18. import flash.text.TextFormatAlign;
  19. import flash.text.TextFieldAutoSize;
  20. import flash.text.AntiAliasType;
  21. import flash.events.MouseEvent;
  22. import jp.progression.casts.*;
  23. import jp.progression.commands.*;
  24. import jp.progression.commands.lists.*;
  25. import jp.progression.commands.net.*;
  26. import jp.progression.config.*;
  27. import jp.progression.data.*;
  28. import jp.progression.events.*;
  29. import jp.progression.scenes.*;
  30. import jp.progression.*;
  31. [SWF( width=465, height=465, backgroundColor=0xFFFFFF, frameRate=30 )]
  32. public class Amateur extends Sprite {
  33. public var manager:Progression, self:Amateur;
  34. //Graphics
  35. public var face:MovieClip;
  36. public var hair:MovieClip;
  37. public var eyeBrowLeft:MovieClip, eyeBrowRight:MovieClip;
  38. public var eyeLeft:MovieClip, eyeRight:MovieClip;
  39. public var nose:MovieClip;
  40. public var mouth:MovieClip;
  41. private var _status:Array;
  42. //*********************************
  43. private var _tensu:TextField = new TextField;
  44. private var _powerbar:Sprite;
  45. private var _mark:Sprite;
  46. private var _movebar:Sprite = new Sprite();
  47. private var _arrow:Sprite;
  48. private var _testball:Sprite;
  49. private var _testball2:Sprite;
  50. private var _friction:Number = 0.96;
  51. private var _count:int;
  52. private var _left:int = 0;
  53. private var _right:int = 465;
  54. private var _top:int = 0;
  55. private var _bottom:int = 465;
  56. private var _rotface:int = 2;
  57. private var _rotmouth:int = 2;
  58. private var _rotnose:int = 2;
  59. private var _rothair:int = 2;
  60. private var _roteyeLeft:int = 2;
  61. private var _roteyeRight:int = 2;
  62. private var _roteyeBrowLeft:int = 2;
  63. private var _roteyeBrowRight:int = 2;
  64. private var _canvasbd:BitmapData;
  65. private var _coltrf:ColorTransform;
  66. private var _powerface:Number;
  67. private var _powermouth:Number;
  68. private var _powernose:Number;
  69. private var _powerhair:Number;
  70. private var _powereyeLeft:Number;
  71. private var _powereyeRight:Number;
  72. private var _powereyeBrowLeft:Number;
  73. private var _powereyeBrowRight:Number;
  74. private var _seek:int = 20;
  75. private var _arrowseek:Number = 0.96;
  76. //ここは意味ない。あとで
  77. private var _vx:Number = 10;
  78. private var _vy:Number = 10;
  79. private var _vx2:Number = 10;
  80. private var _vy2:Number = 10;
  81. private var _vx3:Number = 10;
  82. private var _vy3:Number = 10;
  83. private var _vx4:Number = 10;
  84. private var _vy4:Number = 10;
  85. private var _vx5:Number = 10;
  86. private var _vy5:Number = 10;
  87. private var _vx6:Number = 10;
  88. private var _vy6:Number = 10;
  89. private var _vx7:Number = 10;
  90. private var _vy7:Number = 10;
  91. private var _vx8:Number = 10;
  92. private var _vy8:Number = 10;
  93. private var _bounce:Number = -0.98;
  94. private var _bounce2:Number = -0.98;
  95. private var _bounce3:Number = -0.98;
  96. private var _bounce4:Number = -0.98;
  97. private var _bounce5:Number = -0.98;
  98. private var _bounce6:Number = -0.98;
  99. private var _bounce7:Number = -0.98;
  100. private var _bounce8:Number = -0.98;
  101. //***************************************
  102. // Do Something
  103. public function atReady():void {
  104. addChild( face );
  105. addChild( mouth );
  106. addChild( hair );
  107. addChild( nose );
  108. addChild( eyeLeft );
  109. addChild( eyeRight );
  110. addChild( eyeBrowRight );
  111. addChild( eyeBrowLeft );
  112. _status = [];
  113. for ( var i:int = 0, l:int = numChildren; i < l; i++ ) {
  114. var child:DisplayObject = getChildAt( i );
  115. _status.push( {
  116. x:child.x,
  117. y:child.y,
  118. scaleX:child.scaleX,
  119. scaleY:child.scaleY,
  120. rotation:child.rotation,
  121. visible:false
  122. } );
  123. }
  124. setStage();
  125. //stage.addEventListener( MouseEvent.CLICK, _click );
  126. }
  127. private var _num:int = 0;
  128. private function setStage():void {
  129. _count = 1;
  130. _coltrf = new ColorTransform( 0.8, 0.8, 0.8, 1.0);
  131. _canvasbd = new BitmapData( stage.stageWidth, stage.stageHeight, false, 0x000000 );
  132. addChild( new Bitmap( _canvasbd ) );
  133. for (var i:int = 0; i < 1000; i++) {
  134. var star:Sprite = new Sprite();
  135. star.graphics.beginFill(0xFFFFFF, Math.random());
  136. star.graphics.drawCircle(Math.random() * 465, Math.random() * 465, 1);
  137. star.graphics.endFill();
  138. addChild(star);
  139. }
  140. _powerbar = new Sprite();
  141. _powerbar.graphics.beginFill(0xFFFFFF);
  142. _powerbar.graphics.drawRect(0, 0, 15, 300);
  143. _powerbar.graphics.endFill();
  144. _powerbar.x = 20;
  145. _powerbar.y = 50;
  146. addChild( _powerbar);
  147. _movebar.graphics.beginFill(0xFFFFFF, 0.1);
  148. _movebar.graphics.lineStyle(1, 0xFFFFFF);
  149. _movebar.graphics.drawCircle(0, 0, 50);
  150. _movebar.graphics.endFill();
  151. _movebar.x = 200;
  152. _movebar.y = 420;
  153. //_movebar.width = 50;
  154. addChild( _movebar);
  155. _arrow = new Arrow();
  156. _arrow.x = 35;
  157. _arrow.y = 350 - _arrow.height/2;
  158. addChild( _arrow);
  159. //
  160. var format:TextFormat = new TextFormat();
  161. format.font = "Impact";
  162. format.size = 24;
  163. format.align = TextFormatAlign.CENTER;
  164. _tensu.x = 30;
  165. _tensu.y = 10;
  166. //_tensu.alpha = 1.0
  167. _tensu.text = "??点";
  168. _tensu.selectable = false;
  169. _tensu.type = TextFieldType.DYNAMIC;
  170. _tensu.antiAliasType = AntiAliasType.ADVANCED;
  171. _tensu.autoSize = TextFieldAutoSize.CENTER;
  172. _tensu.textColor = 0xFFFFFF;
  173. _tensu.defaultTextFormat = format;
  174. addChild(_tensu);
  175. var daitext:TextField = new TextField();
  176. daitext.text = "強";
  177. daitext.textColor = 0xFFFFFF;
  178. daitext.x = 20;
  179. daitext.y = 350;
  180. var syoutext:TextField = new TextField();
  181. syoutext.text = "弱";
  182. syoutext.textColor = 0xFFFFFF;
  183. syoutext.x = 20;
  184. syoutext.y = 30;
  185. addChild(daitext);
  186. addChild(syoutext);
  187. setPARTS(_num);
  188. stage.addEventListener(Event.ENTER_FRAME, onloop, false, 10);
  189. stage.addEventListener(MouseEvent.MOUSE_DOWN, ondown);
  190. }
  191. private function setPARTS(num:int):void {
  192. var child:DisplayObject = getChildAt( num );
  193. var status:Object = _status[num];
  194. //var color:ColorTransform = new ColorTransform(Math.random(), Math.random(), Math.random(), 1.0, 0.0, 0.0, 0.0, 0.0);
  195. switch(num) {
  196. case 0:
  197. child.visible = true;
  198. child.x = 200;
  199. child.y = 420;
  200. child.scaleX = 0.5;
  201. child.scaleY = 0.5;
  202. //child.transform.colorTransform = color;
  203. setChildIndex(child, numChildren-1);
  204. break;
  205. case 1:
  206. mouth.x = 200;
  207. mouth.y = 420;
  208. mouth.scaleX = 0.5;
  209. mouth.scaleY = 0.5;
  210. mouth.visible = true;
  211. //addChild(mouth);
  212. break;
  213. case 2:
  214. hair.x = 200;
  215. hair.y = 420;
  216. hair.scaleX = 0.5;
  217. hair.scaleY = 0.5;
  218. //addChild(hair);
  219. break;
  220. case 3:
  221. nose.x = 200;
  222. nose.y = 420;
  223. nose.scaleX = 0.5;
  224. nose.scaleY = 0.5;
  225. //addChild(nose);
  226. break;
  227. case 4:
  228. eyeBrowLeft.x = 200;
  229. eyeBrowLeft.y = 420;
  230. //addChild(eyeBrowLeft);
  231. break;
  232. default:
  233. break;
  234. }
  235. }
  236. //EnterFrame
  237. private function onloop(e:Event):void {
  238. _tensu.text = "0点";
  239. if (_movebar.x >= (465 - _movebar.width)) {
  240. _movebar.x = 465 - _movebar.width;
  241. _seek *= -1;
  242. }else if (_movebar.x <= 0) {
  243. _movebar.x = 0;
  244. _seek *= -1;
  245. }
  246. _movebar.x = _movebar.x + Math.random() * _seek;
  247. //child:DisplayObject = getChildAt( num )だとうまくいかないので
  248. //コマンドをうまく使えばいいのかな? とりあえずお試し中
  249. //trace(_count);
  250. switch(_count) {
  251. case 1:
  252. //trace("1");
  253. face.addEventListener(Event.ENTER_FRAME, moveFace);
  254. break;
  255. case 2:
  256. //trace("2");
  257. mouth.addEventListener(Event.ENTER_FRAME, moveMouth);
  258. break;
  259. case 3:
  260. //trace("3");
  261. hair.addEventListener(Event.ENTER_FRAME, moveHair);
  262. break;
  263. case 4:
  264. //trace("4");
  265. nose.addEventListener(Event.ENTER_FRAME, moveNose);
  266. break;
  267. case 5:
  268. //trace("5");
  269. eyeLeft.addEventListener(Event.ENTER_FRAME, moveeyeLeft);
  270. break;
  271. case 6:
  272. //trace("6");
  273. eyeRight.addEventListener(Event.ENTER_FRAME, moveeyeRight);
  274. break;
  275. case 7:
  276. //trace("7");
  277. eyeBrowRight.addEventListener(Event.ENTER_FRAME, moveeyeBrowRight);
  278. break;
  279. case 8:
  280. //trace("8");
  281. eyeBrowLeft.addEventListener(Event.ENTER_FRAME, moveeyeBrowLeft);
  282. break;
  283. default:
  284. break;
  285. }
  286. if (_arrow.y >= 350 - _arrow.height/2) {
  287. _arrow.y = 350 - _arrow.height / 2;
  288. _arrowseek *= -1;
  289. }else if (_arrow.y <= 50) {
  290. _arrow.y = 50;
  291. _arrowseek *= -1;
  292. }
  293. _arrow.y = (_arrow.y + 5 * _arrowseek);
  294. //**************************************
  295. if (_powerface == 0) {
  296. face.removeEventListener(Event.ENTER_FRAME, goface);
  297. }
  298. if (_powermouth == 0) {
  299. mouth.removeEventListener(Event.ENTER_FRAME, gomouth);
  300. }
  301. if(_powerhair == 0) {
  302. hair.removeEventListener(Event.ENTER_FRAME, gohair);
  303. }
  304. if(_powernose == 0) {
  305. nose.removeEventListener(Event.ENTER_FRAME, gonose);
  306. }
  307. if(_powereyeRight == 0) {
  308. eyeRight.removeEventListener(Event.ENTER_FRAME, goeyeright);
  309. }
  310. if(_powereyeLeft == 0) {
  311. eyeLeft.removeEventListener(Event.ENTER_FRAME, goeyeleft);
  312. }
  313. if(_powereyeBrowRight == 0) {
  314. eyeBrowRight.removeEventListener(Event.ENTER_FRAME, goeyebrowright);
  315. }
  316. if(_powereyeBrowLeft == 0) {
  317. eyeBrowLeft.removeEventListener(Event.ENTER_FRAME, goeyebrowleft);
  318. }
  319. if (_powerface + _powermouth + _powerhair + _powernose + _powereyeRight + _powereyeLeft + _powereyeBrowRight + _powereyeBrowLeft == 0) {
  320. //点数計算a
  321. lastcalc();
  322. stage.removeEventListener(Event.ENTER_FRAME, onloop);
  323. }
  324. }
  325. private function lastcalc():void {
  326. //face+nose+hair+moutheyeRight+mouth+eyeLeft+eyeLeft+eyeRight + 16
  327. var kao:Number = (234 + 242) + (242 + 322) + (233 + 194) + (236 + 275) + (272 + 243) + (190 + 248) + (190 + 218) + (270 + 218) + 16
  328. var kaox:Number = (face.x + face.y + face.scaleX + face.scaleY) + (nose.x + nose.y + nose.scaleX + nose.scaleY) + (hair.x + hair.y+ hair.scaleX + hair.scaleY) + (mouth.x + mouth.y+ mouth.scaleX + mouth.scaleY) +
  329. (eyeLeft.x + eyeLeft.y + eyeLeft.scaleX + eyeLeft.scaleY ) + (eyeRight.x + eyeRight.y + eyeRight.scaleX * eyeRight.scaleY) +
  330. (eyeBrowLeft.x + eyeBrowLeft.y+ eyeBrowLeft.scaleX + eyeBrowLeft.scaleY) +(eyeBrowRight.x + eyeBrowRight.y + eyeBrowRight.scaleX + eyeBrowRight.scaleY);
  331. var genten:Number = 0;
  332. if (kao >= kaox) {
  333. genten = kao - kaox;
  334. } else {
  335. genten = kaox - kao;
  336. }
  337. var kaoten:Number = 100 - genten;
  338. //var kaoten:Number = (100 * kaox) / kao;
  339. _tensu.text = Math.round(kaoten * 1000) / 1000 + "点";
  340. //stage.addChild(tensu);
  341. }
  342. private function moveFace(e:Event):void {
  343. //var child:DisplayObject = getChildAt( numChildren-1 );
  344. //var status:Object = _status[numChildren-1];
  345. //trace("moveF");
  346. //trace(child);
  347. face.x = _movebar.x; //+ _movebar.width / 2;
  348. if (face.rotation >= 0) {
  349. _rotface *= -1;
  350. } else if (face.rotation <= -180) {
  351. _rotface *= -1;
  352. }
  353. face.rotation += _rotface;
  354. }
  355. private function moveMouth(e:Event):void {
  356. //var child:DisplayObject = getChildAt( numChildren-1 );
  357. //var status:Object = _status[numChildren-1];
  358. //trace("moveM");
  359. //trace(child);
  360. mouth.x = _movebar.x; // + _movebar.width / 2;
  361. if (mouth.rotation >= 0) {
  362. _rotmouth *= -1;
  363. } else if (mouth.rotation <= -180) {
  364. _rotmouth *= -1;
  365. }
  366. mouth.rotation += _rotmouth;
  367. }
  368. private function moveHair(e:Event):void {
  369. //var child:DisplayObject = getChildAt( numChildren-1 );
  370. //var status:Object = _status[numChildren-1];
  371. //trace("moveH");
  372. //trace(child);
  373. hair.x = _movebar.x; //+ _movebar.width / 2;
  374. if (hair.rotation >= 0) {
  375. _rothair *= -1;
  376. } else if (hair.rotation <= -180) {
  377. _rothair *= -1;
  378. }
  379. hair.rotation += _rothair;
  380. }
  381. private function moveNose(e:Event):void {
  382. nose.x = _movebar.x; //+ _movebar.width / 2;
  383. if (nose.rotation >= 0) {
  384. _rotnose *= -1;
  385. } else if (nose.rotation <= -180) {
  386. _rotnose *= -1;
  387. }
  388. nose.rotation += _rotnose;
  389. }
  390. private function moveeyeLeft(e:Event):void {
  391. eyeLeft.x = _movebar.x; // + _movebar.width / 2;
  392. if (eyeLeft.rotation >= 0) {
  393. _roteyeLeft *= -1;
  394. } else if (eyeLeft.rotation <= -180) {
  395. _roteyeLeft *= -1;
  396. }
  397. eyeLeft.rotation += _roteyeLeft;
  398. }
  399. private function moveeyeRight(e:Event):void {
  400. eyeRight.x = _movebar.x; //+ _movebar.width / 2;
  401. if (eyeRight.rotation >= 0) {
  402. _roteyeRight *= -1;
  403. } else if (eyeRight.rotation <= -180) {
  404. _roteyeRight *= -1;
  405. }
  406. eyeRight.rotation += _roteyeRight;
  407. }
  408. private function moveeyeBrowLeft(e:Event):void {
  409. eyeBrowLeft.x = _movebar.x; //+ _movebar.width / 2;
  410. if (eyeBrowLeft.rotation >= 0) {
  411. _roteyeBrowLeft *= -1;
  412. } else if (eyeBrowLeft.rotation <= -180) {
  413. _roteyeBrowLeft *= -1;
  414. }
  415. eyeBrowLeft.rotation += _roteyeBrowLeft;
  416. }
  417. private function moveeyeBrowRight(e:Event):void {
  418. eyeBrowRight.x = _movebar.x; //+ _movebar.width / 2;
  419. if (eyeBrowRight.rotation >= 0) {
  420. _roteyeBrowRight *= -1;
  421. } else if (eyeBrowRight.rotation <= -180) {
  422. _roteyeBrowRight *= -1;
  423. }
  424. eyeBrowRight.rotation += _roteyeBrowRight;
  425. }
  426. //***********************************************************
  427. private function ondown(e:MouseEvent):void {
  428. var arrowp:Number;
  429. var movebarp:Number;
  430. var power:Number;
  431. //trace("ondown");
  432. //stage.removeEventListener(Event.ENTER_FRAME, onloop);
  433. stage.removeEventListener(MouseEvent.MOUSE_DOWN, ondown);
  434. //movebarp = _movebar.x;
  435. switch(_count) {
  436. case 1:
  437. _powerface = _arrow.y;
  438. face.addEventListener(Event.ENTER_FRAME, goface);
  439. break;
  440. case 2:
  441. _powermouth = _arrow.y;
  442. mouth.addEventListener(Event.ENTER_FRAME, gomouth);
  443. break;
  444. case 3:
  445. _powerhair = _arrow.y;
  446. hair.addEventListener(Event.ENTER_FRAME, gohair);
  447. break;
  448. case 4:
  449. _powernose = _arrow.y;
  450. nose.addEventListener(Event.ENTER_FRAME, gonose);
  451. break;
  452. case 5:
  453. _powereyeLeft = _arrow.y;
  454. eyeLeft.addEventListener(Event.ENTER_FRAME, goeyeleft);
  455. break;
  456. case 6:
  457. _powereyeRight = _arrow.y;
  458. eyeRight.addEventListener(Event.ENTER_FRAME, goeyeright);
  459. break;
  460. case 7:
  461. _powereyeBrowRight = _arrow.y;
  462. eyeBrowRight.addEventListener(Event.ENTER_FRAME, goeyebrowright);
  463. break;
  464. case 8:
  465. _powereyeBrowLeft = _arrow.y;
  466. eyeBrowLeft.addEventListener(Event.ENTER_FRAME, goeyebrowleft);
  467. break;
  468. default:
  469. break;
  470. }
  471. stage.addEventListener(MouseEvent.MOUSE_UP, onup);
  472. }
  473. private function goface(e:Event):void {
  474. var mtx:Matrix = new Matrix();
  475. //trace("aaa");
  476. face.y += Math.sin(face.rotation * Math.PI / 180) * _vy * _powerface / 10;
  477. face.x += Math.cos(face.rotation * Math.PI / 180) * _vx * _powerface / 10;
  478. mtx.rotate(face.rotation * Math.PI / 180);
  479. mtx.scale(0.5, 0.5);
  480. mtx.tx = face.x;
  481. mtx.ty = face.y;
  482. _canvasbd.draw(face, mtx );
  483. //trace(_testball.rotation);
  484. _canvasbd.colorTransform(_canvasbd.rect, _coltrf );
  485. hitWallFace();
  486. if (_powerface <= 5) {
  487. _powerface = 0;
  488. face.x = 234 + ( Math.random() - 0.5 ) * 10; //232;
  489. face.y = 242 + ( Math.random() - 0.5 ) * 10; //232;
  490. face.scaleX = 1 + ( Math.random() - 0.5 ) / 2; //1.0;
  491. face.scaleY = 1 + ( Math.random() - 0.5 ) / 2; //1.0;
  492. face.rotation = 0 + ( Math.random() - 0.5 ) * 10;
  493. face.removeEventListener(Event.ENTER_FRAME, moveFace);
  494. } else {
  495. _powerface -= 2;
  496. }
  497. }
  498. private function gomouth(e:Event):void {
  499. var mtx:Matrix = new Matrix();
  500. mouth.y += Math.sin(mouth.rotation * Math.PI / 180) * _vy2 * _powermouth / 10;
  501. mouth.x += Math.cos(mouth.rotation * Math.PI / 180) * _vx2 * _powermouth / 10;
  502. mtx.rotate(mouth.rotation * Math.PI / 180);
  503. //mtx.scale(1, 1);
  504. mtx.tx = mouth.x;
  505. mtx.ty = mouth.y;
  506. _canvasbd.draw(mouth, mtx );
  507. //trace(_testball.rotation);
  508. _canvasbd.colorTransform(_canvasbd.rect, _coltrf );
  509. hitWallMouth();
  510. //x,y 242,322
  511. if (_powermouth <= 5) {
  512. _powermouth = 0;
  513. mouth.x = 242 + ( Math.random() - 0.5 ) * 10;
  514. mouth.y = 322 + ( Math.random() - 0.5 ) * 10;
  515. mouth.scaleX = 1 + ( Math.random() - 0.5 ) / 2;
  516. mouth.scaleY = 1 + ( Math.random() - 0.5 ) / 2;
  517. mouth.rotation = 1 + ( Math.random() - 0.5 ) * 10;
  518. //face.removeEventListener(Event.ENTER_FRAME, goface);
  519. mouth.removeEventListener(Event.ENTER_FRAME, moveMouth);
  520. } else {
  521. _powermouth -= 2;
  522. }
  523. }
  524. private function gohair(e:Event):void {
  525. var mtx:Matrix = new Matrix();
  526. hair.y += Math.sin(hair.rotation * Math.PI / 180) * _vy3 * _powerhair / 10;
  527. hair.x += Math.cos(hair.rotation * Math.PI / 180) * _vx3 * _powerhair / 10;
  528. mtx.rotate(hair.rotation * Math.PI / 180);
  529. mtx.scale(0.5, 0.5);
  530. mtx.tx = hair.x;
  531. mtx.ty = hair.y;
  532. _canvasbd.draw(hair, mtx );
  533. //trace(_testball.rotation);
  534. _canvasbd.colorTransform(_canvasbd.rect, _coltrf );
  535. hitWallHair();
  536. //233,194ꏊ
  537. if (_powerhair <= 5) {
  538. _powerhair = 0;
  539. hair.x = 233 + ( Math.random() - 0.5 ) * 10;
  540. hair.y = 194 + ( Math.random() - 0.5 ) * 10;
  541. hair.scaleX = 1 + ( Math.random() - 0.5 ) / 2;
  542. hair.scaleY = 1 + ( Math.random() - 0.5 ) / 2;
  543. hair.rotation = 1 + ( Math.random() - 0.5 ) * 10;
  544. //mouth.removeEventListener(Event.ENTER_FRAME, gomouth);
  545. hair.removeEventListener(Event.ENTER_FRAME, moveHair);
  546. } else {
  547. _powerhair -= 2;
  548. }
  549. }
  550. private function gonose(e:Event):void {
  551. var mtx:Matrix = new Matrix();
  552. //trace("aaa");
  553. nose.y += Math.sin(nose.rotation * Math.PI / 180) * _vy4 * _powernose / 10;
  554. nose.x += Math.cos(nose.rotation * Math.PI / 180) * _vx4 * _powernose / 10;
  555. mtx.rotate(nose.rotation * Math.PI / 180);
  556. //mtx.scale(1, 1);
  557. mtx.tx = nose.x;
  558. mtx.ty = nose.y;
  559. _canvasbd.draw(nose, mtx );
  560. //trace(_testball.rotation);
  561. _canvasbd.colorTransform(_canvasbd.rect, _coltrf );
  562. hitWallNose();
  563. //236,275
  564. if (_powernose <= 5) {
  565. _powernose = 0;
  566. nose.x = 236 + ( Math.random() - 0.5 ) * 10;
  567. nose.y = 275 + ( Math.random() - 0.5 ) * 10;
  568. nose.scaleX = 1 + ( Math.random() - 0.5 ) / 2;
  569. nose.scaleY = 1 + ( Math.random() - 0.5 ) / 2;
  570. nose.rotation = 1 + ( Math.random() - 0.5 ) * 10;
  571. //hair.removeEventListener(Event.ENTER_FRAME, gohair);
  572. nose.removeEventListener(Event.ENTER_FRAME, moveNose);
  573. } else {
  574. _powernose -= 2;
  575. }
  576. }
  577. private function goeyeleft(e:Event):void {
  578. var mtx:Matrix = new Matrix();
  579. //trace("aaa");
  580. eyeLeft.y += Math.sin(eyeLeft.rotation * Math.PI / 180) * _vy5 * _powereyeLeft / 10;
  581. eyeLeft.x += Math.cos(eyeLeft.rotation * Math.PI / 180) * _vx5 * _powereyeLeft / 10;
  582. mtx.rotate(eyeLeft.rotation * Math.PI / 180);
  583. //mtx.scale(1, 1);
  584. mtx.tx = eyeLeft.x;
  585. mtx.ty = eyeLeft.y;
  586. _canvasbd.draw(eyeLeft, mtx );
  587. //trace(_testball.rotation);
  588. _canvasbd.colorTransform(_canvasbd.rect, _coltrf );
  589. hitWalleyeLeft();
  590. //272, 243
  591. if (_powereyeLeft <= 5) {
  592. _powereyeLeft = 0;
  593. eyeLeft.x = 272 + ( Math.random() - 0.5 ) * 10;
  594. eyeLeft.y = 243 + ( Math.random() - 0.5 ) * 10;
  595. eyeLeft.scaleX = 1 + ( Math.random() - 0.5 ) / 2;
  596. eyeLeft.scaleY = 1 + ( Math.random() - 0.5 ) / 2;
  597. eyeLeft.rotation = 1 + ( Math.random() - 0.5 ) * 10;
  598. //nose.removeEventListener(Event.ENTER_FRAME, gonose);
  599. eyeLeft.removeEventListener(Event.ENTER_FRAME, moveeyeLeft);
  600. } else {
  601. _powereyeLeft -= 2;
  602. }
  603. }
  604. private function goeyeright(e:Event):void {
  605. var mtx:Matrix = new Matrix();
  606. //trace("aaa");
  607. eyeRight.y += Math.sin(eyeRight.rotation * Math.PI / 180) * _vy6 * _powereyeRight / 10;
  608. eyeRight.x += Math.cos(eyeRight.rotation * Math.PI / 180) * _vx6 * _powereyeRight / 10;
  609. mtx.rotate(eyeRight.rotation * Math.PI / 180);
  610. //mtx.scale(1, 1);
  611. mtx.tx = eyeRight.x;
  612. mtx.ty = eyeRight.y;
  613. _canvasbd.draw(eyeRight, mtx );
  614. //trace(_testball.rotation);
  615. _canvasbd.colorTransform(_canvasbd.rect, _coltrf );
  616. hitWalleyeRight()
  617. //190,248
  618. if (_powereyeRight <= 5) {
  619. _powereyeRight = 0;
  620. eyeRight.x = 190 + ( Math.random() - 0.5 ) * 10;
  621. eyeRight.y = 248 + ( Math.random() - 0.5 ) * 10;
  622. eyeRight.scaleX = 1 + ( Math.random() - 0.5 ) / 2;
  623. eyeRight.scaleY = 1 + ( Math.random() - 0.5 ) / 2;
  624. eyeRight.rotation = 1 + ( Math.random() - 0.5 ) * 10;
  625. //eyeLeft.removeEventListener(Event.ENTER_FRAME, goeyeleft);
  626. eyeRight.removeEventListener(Event.ENTER_FRAME, moveeyeRight);
  627. } else {
  628. _powereyeRight -= 2;
  629. }
  630. }
  631. private function goeyebrowright(e:Event):void {
  632. var mtx:Matrix = new Matrix();
  633. //trace("aaa");
  634. eyeBrowRight.y += Math.sin(eyeBrowRight.rotation * Math.PI / 180) * _vy7 * _powereyeBrowRight / 10;
  635. eyeBrowRight.x += Math.cos(eyeBrowRight.rotation * Math.PI / 180) * _vx7 * _powereyeBrowRight / 10;
  636. mtx.rotate(eyeBrowRight.rotation * Math.PI / 180);
  637. //mtx.scale(1, 1);
  638. mtx.tx = eyeBrowRight.x;
  639. mtx.ty = eyeBrowRight.y;
  640. _canvasbd.draw(eyeBrowRight, mtx );
  641. //trace(_testball.rotation);
  642. _canvasbd.colorTransform(_canvasbd.rect, _coltrf );
  643. hitWalleyeBrowRight();
  644. //190,218
  645. if (_powereyeBrowRight <= 5) {
  646. _powereyeBrowRight = 0;
  647. eyeBrowRight.x = 190 + ( Math.random() - 0.5 ) * 10;
  648. eyeBrowRight.y = 218 + ( Math.random() - 0.5 ) * 10;
  649. eyeBrowRight.scaleX = 1 + ( Math.random() - 0.5 ) / 2;
  650. eyeBrowRight.scaleY = 1 + ( Math.random() - 0.5 ) / 2;
  651. eyeBrowRight.rotation = 1 + ( Math.random() - 0.5 ) * 10;
  652. //eyeRight.removeEventListener(Event.ENTER_FRAME, goeyeright);
  653. eyeBrowRight.removeEventListener(Event.ENTER_FRAME, moveeyeBrowRight);
  654. } else {
  655. _powereyeBrowRight -= 2;
  656. }
  657. }
  658. private function goeyebrowleft(e:Event):void {
  659. var mtx:Matrix = new Matrix();
  660. //trace("aaa");
  661. eyeBrowLeft.y += Math.sin(eyeBrowLeft.rotation * Math.PI / 180) * _vy8 * _powereyeBrowLeft / 10;
  662. eyeBrowLeft.x += Math.cos(eyeBrowLeft.rotation * Math.PI / 180) * _vx8 * _powereyeBrowLeft / 10;
  663. mtx.rotate(eyeBrowLeft.rotation * Math.PI / 180);
  664. //mtx.scale(1, 1);
  665. mtx.tx = eyeBrowLeft.x;
  666. mtx.ty = eyeBrowLeft.y;
  667. _canvasbd.draw(eyeBrowLeft, mtx );
  668. //trace(_testball.rotation);
  669. _canvasbd.colorTransform(_canvasbd.rect, _coltrf );
  670. hitWalleyeBrowLeft();
  671. //270,218
  672. if (_powereyeBrowLeft <= 5) {
  673. _powereyeBrowLeft = 0;
  674. eyeBrowLeft.x = 270 + ( Math.random() - 0.5 ) * 10;
  675. eyeBrowLeft.y = 218 + ( Math.random() - 0.5 ) * 10;
  676. eyeBrowLeft.scaleX = 1 + ( Math.random() - 0.5 ) / 2;
  677. eyeBrowLeft.scaleY = 1 + ( Math.random() - 0.5 ) / 2;
  678. eyeBrowLeft.rotation = 1 + ( Math.random() - 0.5 ) * 10;
  679. //ここでも判定 //
  680. if (_powerface == 0) {
  681. face.removeEventListener(Event.ENTER_FRAME, goface);
  682. }
  683. if (_powermouth == 0) {
  684. mouth.removeEventListener(Event.ENTER_FRAME, gomouth);
  685. }
  686. if(_powerhair == 0) {
  687. hair.removeEventListener(Event.ENTER_FRAME, gohair);
  688. }
  689. if(_powernose == 0) {
  690. nose.removeEventListener(Event.ENTER_FRAME, gonose);
  691. }
  692. if(_powereyeRight == 0) {
  693. eyeRight.removeEventListener(Event.ENTER_FRAME, goeyeright);
  694. }
  695. if(_powereyeLeft == 0) {
  696. eyeLeft.removeEventListener(Event.ENTER_FRAME, goeyeleft);
  697. }
  698. if(_powereyeBrowRight == 0) {
  699. eyeBrowRight.removeEventListener(Event.ENTER_FRAME, goeyebrowright);
  700. }
  701. if(_powereyeBrowLeft == 0) {
  702. eyeBrowLeft.removeEventListener(Event.ENTER_FRAME, goeyebrowleft);
  703. }
  704. eyeBrowLeft.removeEventListener(Event.ENTER_FRAME, moveeyeBrowLeft);
  705. } else {
  706. _powereyeBrowLeft -= 2;
  707. }
  708. }
  709. //hitTest
  710. private function hitWallFace():void {
  711. //trace(face.x);
  712. if (_left >= face.x) {
  713. face.x = 10;
  714. _vx *= _bounce;
  715. } else if (_right <= face.x) {
  716. face.x = 465;
  717. _vx *= _bounce;
  718. } else if (face.y >= _bottom) {
  719. face.y = 465;
  720. _vy *= _bounce;
  721. } else if (face.y <= _top) {
  722. face.y = 0;
  723. _vy *= _bounce;
  724. }
  725. }
  726. private function hitWallMouth():void {
  727. //trace(face.x);
  728. if (_left >= mouth.x) {
  729. mouth.x = 10;
  730. _vx2 *= _bounce2;
  731. } else if (_right <= mouth.x) {
  732. mouth.x = 465;
  733. _vx2 *= _bounce2;
  734. } else if (mouth.y >= _bottom) {
  735. mouth.y = 465;
  736. _vy2 *= _bounce2;
  737. } else if (mouth.y <= _top) {
  738. mouth.y = 0;
  739. _vy2 *= _bounce2;
  740. }
  741. }
  742. private function hitWallNose():void {
  743. if (_left >= nose.x) {
  744. nose.x = 10;
  745. _vx4 *= _bounce4;
  746. } else if (_right <= nose.x) {
  747. nose.x = 465;
  748. _vx4 *= _bounce4;
  749. } else if (nose.y >= _bottom) {
  750. nose.y = 465;
  751. _vy4 *= _bounce4;
  752. } else if (nose.y <= _top) {
  753. nose.y = 0;
  754. _vy4 *= _bounce4;
  755. }
  756. }
  757. private function hitWallHair():void {
  758. if (_left >= hair.x) {
  759. hair.x = 10;
  760. _vx3 *= _bounce3;
  761. } else if (_right <= hair.x) {
  762. hair.x = 465;
  763. _vx3 *= _bounce3;
  764. } else if (hair.y >= _bottom) {
  765. hair.y = 465;
  766. _vy3 *= _bounce3;
  767. } else if (hair.y <= _top) {
  768. hair.y = 0;
  769. _vy3 *= _bounce3;
  770. }
  771. }
  772. private function hitWalleyeLeft():void {
  773. if (_left >= eyeLeft.x) {
  774. eyeLeft.x = 10;
  775. _vx5 *= _bounce5;
  776. } else if (_right <= eyeLeft.x) {
  777. eyeLeft.x = 465;
  778. _vx5 *= _bounce5;
  779. } else if (eyeLeft.y >= _bottom) {
  780. eyeLeft.y = 465;
  781. _vy5 *= _bounce5;
  782. } else if (eyeLeft.y <= _top) {
  783. eyeLeft.y = 0;
  784. _vy5 *= _bounce5;
  785. }
  786. }
  787. private function hitWalleyeRight():void {
  788. if (_left >= eyeRight.x) {
  789. eyeRight.x = 10;
  790. _vx6 *= _bounce6;
  791. } else if (_right <= eyeRight.x) {
  792. eyeRight.x = 465;
  793. _vx6 *= _bounce6;
  794. } else if (eyeRight.y >= _bottom) {
  795. eyeRight.y = 465;
  796. _vy6 *= _bounce6;
  797. } else if (eyeRight.y <= _top) {
  798. eyeRight.y = 0;
  799. _vy6 *= _bounce6;
  800. }
  801. }
  802. private function hitWalleyeBrowRight():void {
  803. if (_left >= eyeBrowRight.x) {
  804. eyeBrowRight.x = 10;
  805. _vx7 *= _bounce7;
  806. } else if (_right <= eyeBrowRight.x) {
  807. eyeBrowRight.x = 465;
  808. _vx7 *= _bounce7;
  809. } else if (eyeBrowRight.y >= _bottom) {
  810. eyeBrowRight.y = 465;
  811. _vy7 *= _bounce7;
  812. } else if (eyeBrowRight.y <= _top) {
  813. eyeBrowRight.y = 0;
  814. _vy7 *= _bounce7;
  815. }
  816. }
  817. private function hitWalleyeBrowLeft():void {
  818. if (_left >= eyeBrowLeft.x) {
  819. eyeBrowLeft.x = 10;
  820. _vx8 *= _bounce8;
  821. } else if (_right <= eyeBrowLeft.x) {
  822. eyeBrowLeft.x = 465;
  823. _vx8 *= _bounce8;
  824. } else if (eyeBrowLeft.y >= _bottom) {
  825. eyeBrowLeft.y = 465;
  826. _vy8 *= _bounce8;
  827. } else if (eyeBrowLeft.y <= _top) {
  828. eyeBrowLeft.y = 0;
  829. _vy8 *= _bounce8;
  830. }
  831. }
  832. private function onup(e:MouseEvent):void {
  833. stage.removeEventListener(MouseEvent.MOUSE_UP, onup);
  834. _count += 1;
  835. _num += 1;
  836. if (_count <= 8) {
  837. setPARTS(0);
  838. stage.addEventListener(MouseEvent.MOUSE_DOWN, ondown);
  839. } else {
  840. _movebar.alpha = 0.1;
  841. //stage.removeEventListener(Event.ENTER_FRAME, onloop);
  842. }
  843. //trace("onup");
  844. //stage.addEventListener(Event.ENTER_FRAME, onloop);
  845. //trace("ondownList");
  846. }
  847. public function Amateur() {
  848. CheckmateBuilder.initialize( this );
  849. }
  850. }
  851. }
  852. ///////////////////////////////////////////////////////////////////////////////
  853. import flash.display.*;
  854. import flash.events.*;
  855. import flash.net.URLRequest;
  856. import flash.system.ApplicationDomain;
  857. import jp.progression.casts.*;
  858. import jp.progression.commands.*;
  859. import jp.progression.commands.lists.*;
  860. import jp.progression.commands.net.*;
  861. import jp.progression.config.*;
  862. import jp.progression.data.*;
  863. import jp.progression.events.*;
  864. import jp.progression.scenes.*;
  865. import jp.progression.*;
  866. class CheckmateBuilder extends EventDispatcher {
  867. public static var GRAPHICS_URL:String = "http://swf.wonderfl.net/static/assets/checkmate04/AmateurAssets.swf";
  868. private static var _target:Amateur;
  869. private static var _manager:Progression;
  870. public static function initialize( target:Amateur ):void {
  871. if ( _target ) { return; }
  872. _target = target;
  873. _target.self = target;
  874. Progression.initialize( new BasicAppConfig() );
  875. _manager = new Progression( "index", _target.stage );
  876. _manager.root.addEventListener( SceneEvent.SCENE_LOAD, _sceneLoad );
  877. _manager.root.addEventListener( SceneEvent.SCENE_INIT_COMPLETE, _sceneInitComplete );
  878. _manager.goto( _manager.root.sceneId );
  879. }
  880. private static function _sceneLoad( e:SceneEvent ):void {
  881. _manager.root.addCommand(
  882. new LoadSWF( new URLRequest( GRAPHICS_URL ) ),
  883. function():void {
  884. var loader:Loader = Loader( this.latestData );
  885. var domain:ApplicationDomain = loader.contentLoaderInfo.applicationDomain;
  886. _target.face = new ( domain.getDefinition( "Face" ) as Class );
  887. _target.face.x = 234;
  888. _target.face.y = 242;
  889. _target.hair = new ( domain.getDefinition( "Hair" ) as Class );
  890. _target.hair.x = 233;
  891. _target.hair.y = 194;
  892. _target.eyeBrowRight = new ( domain.getDefinition( "EyeBrowRight" ) as Class );
  893. _target.eyeBrowRight.x = 190;
  894. _target.eyeBrowRight.y = 218;
  895. _target.eyeBrowLeft = new ( domain.getDefinition( "EyeBrowLeft" ) as Class );
  896. _target.eyeBrowLeft.x = 270;
  897. _target.eyeBrowLeft.y = 218;
  898. _target.eyeRight = new ( domain.getDefinition( "EyeRight" ) as Class );
  899. _target.eyeRight.x = 190;
  900. _target.eyeRight.y = 248;
  901. _target.eyeLeft = new ( domain.getDefinition( "EyeLeft" ) as Class );
  902. _target.eyeLeft.x = 272;
  903. _target.eyeLeft.y = 243;
  904. _target.nose = new ( domain.getDefinition( "Nose" ) as Class );
  905. _target.nose.x = 236;
  906. _target.nose.y = 275;
  907. _target.mouth = new ( domain.getDefinition( "Mouth" ) as Class );
  908. _target.mouth.x = 242;
  909. _target.mouth.y = 322;
  910. }
  911. );
  912. }
  913. private static function _sceneInitComplete( e:SceneEvent ):void {
  914. _target.atReady();
  915. }
  916. }
  917. import flash.text.TextField;
  918. internal class Arrow extends Sprite {
  919. public function Arrow() {
  920. drawArrow();
  921. }
  922. private function drawArrow():void {
  923. graphics.clear();
  924. graphics.beginFill(0x0000FF);
  925. graphics.lineStyle(1, 0xffffff);
  926. graphics.moveTo(10, 0);
  927. graphics.lineTo(10, 10);
  928. graphics.lineTo( 0, 5);
  929. graphics.lineTo(10, 0);
  930. graphics.endFill();
  931. }
  932. }
flash swf thumbnail play
出題者からのコメント
あえて複雑なプロセス(=ゲーム)を辿らせることで、成果(=変な顔)に対して謎の達成感が生まれる点が面白いですね!
Comments from King
It's interesting that I feel a kind of accomplishment for editing weird face, by going through complex process.

ad

Professional

Queenizm_design

  1. // forked from oshige's forked from: Progression4.xに追加してほしいことー!forked from: Progression4 Professional
  2. // forked from izm_design's Progression4.xに追加してほしいことー!forked from: Progression4 Professional
  3. //がんばってみた!iPhoneを表示させるところ、本当はgetResourceByIdを使いたかったんだけど、
  4. //なぜかできなかった(?)のでloaderで力技でやってみました。
  5. //あと単純にaddChild()してるだけなので、もどれなくなっちゃいました。
  6. //oshigeさんのコードを参考にして書き換えました。戻れるようになったよ!
  7. // forked from checkmate's Progression4 Professional
  8. // forked from test_doke's flash on 2009-9-29
  9. package {
  10.     
  11.         import caurina.transitions.Equations;
  12.         
  13.         import flash.display.*;
  14.         import flash.net.URLRequest;
  15.         
  16.         import jp.progression.*;
  17.         import jp.progression.casts.*;
  18.         import jp.progression.commands.*;
  19.         import jp.progression.commands.display.*;
  20.         import jp.progression.commands.lists.*;
  21.         import jp.progression.commands.net.*;
  22.         import jp.progression.commands.tweens.*;
  23.         
  24.         [SWF( width=465, height=465, backgroundColor=0xFFFFFF, frameRate=30 )]
  25.         public class Professional extends Sprite {
  26.                 public var manager:Progression, self:Professional;
  27.                 
  28.                 // Graphics
  29.                 public var scene1_Balloon1:MovieClip, scene1_Balloon2:MovieClip, scene1_Brother:MovieClip;
  30.                 public var scene2_Brother:MovieClip, scene2_Shout:MovieClip;
  31.                 public var scene3_Brother:MovieClip, scene3_CutIn1:MovieClip, scene3_CutIn2:MovieClip, scene3_SE:MovieClip, scene3_Sister:MovieClip;
  32.                 public var scene4_Balloon:MovieClip, scene4_Brother:MovieClip, scene4_Sister:MovieClip;
  33.                 
  34.                 public var container:CastSprite;
  35.                 public var container2:CastSprite;
  36.                 public var sp:Sprite;
  37.                 private var loader:Loader;
  38.                 
  39.                 // First Scene
  40.                 public function introduction():void {
  41.                         manager.current.addCommand(
  42.                                 new RemoveAllChildren( container ),
  43.                                 [
  44.                                         [
  45.                                                 new Prop( scene1_Brother, { y:435 } ),
  46.                                                 new AddChild( container, scene1_Brother ),
  47.                                                 new DoTweener( scene1_Brother, { y:335, time:7 } )
  48.                                         ],
  49.                                         [
  50.                                                 1,
  51.                                                 new Prop( scene1_Balloon1, { alpha:0 } ),
  52.                                                 new AddChild( container, scene1_Balloon1 ),
  53.                                                 new DoTweener( scene1_Balloon1, { alpha:1, time:1 } )
  54.                                         ],
  55.                                         [
  56.                                                 2,
  57.                                                 new Prop( scene1_Balloon2, { alpha:0 } ),
  58.                                                 new AddChild( container, scene1_Balloon2 ),
  59.                                                 new DoTweener( scene1_Balloon2, { alpha:1, time:1 } )
  60.                                         ]
  61.                                 ]
  62.                         );
  63.                 }
  64.                 // Second Scene
  65.                 public function development():void {
  66.                         manager.current.addCommand(
  67.                                 new RemoveAllChildren( container ),
  68.                                 [
  69.                                         [
  70.                                                 new Prop( scene2_Brother, { scaleX:0.3, scaleY:0.3 } ),
  71.                                                 new AddChild( container, scene2_Brother ),
  72.                                                 new DoTweener( scene2_Brother, { scaleX:1, scaleY:1, time:1, transition:Equations.easeOutElastic } )
  73.                                         ],
  74.                                         [
  75.                                                 0.1,
  76.                                                 new Prop( scene2_Shout, { scaleX:0.3, scaleY:0.3 } ),
  77.                                                 new AddChild( container, scene2_Shout ),
  78.                                                 new DoTweener( scene2_Shout, { scaleX:1, scaleY:1, time:1, transition:Equations.easeOutElastic } )
  79.                                         ]
  80.                                 ]
  81.                         );
  82.                 }
  83.                 // Third Scene
  84.                 public function turn():void {
  85.                         manager.current.addCommand(
  86.                                 [
  87.                                         [
  88.                                                 new RemoveAllChildren( container ),
  89.                                                 new RemoveAllChildren( container2 ),
  90.                                                 new Prop(container, { x:0, y:0, scaleX:1, scaleY:1}),
  91.                                                 new Prop(sp,        { x:0, y:0, scaleX:1, scaleY:1})
  92.                                         ],
  93.                                         [
  94.                                                 new Prop( scene3_Brother, { x:130, scaleX:0.7, scaleY:0.7 } ),
  95.                                                 new AddChild( container, scene3_Brother ),
  96.                                                 new DoTweener( scene3_Brother, { x:230, scaleX:1, scaleY:1, time:1, transition:Equations.easeOutElastic } )
  97.                                         ],
  98.                                         [
  99.                                                 new Prop( scene3_Sister, { x:-300, scaleX:0.7, scaleY:0.7 } ),
  100.                                                 new AddChild( container, scene3_Sister ),
  101.                                                 new DoTweener( scene3_Sister, { x:0, scaleX:1, scaleY:1, time:1, transition:Equations.easeOutElastic } )
  102.                                         ],
  103.                                         new AddChild( container, scene3_CutIn1 ),
  104.                                         new AddChild( container, scene3_CutIn2 ),
  105.                                         [
  106.                                                 new Prop( scene3_SE, { scaleX:0.3, scaleY:0.3 } ),
  107.                                                 new AddChild( container, scene3_SE ),
  108.                                                 new DoTweener( scene3_SE, { scaleX:1, scaleY:1, time:1, transition:Equations.easeOutElastic } )
  109.                                         ]
  110.                                 ]
  111.                         );
  112.                 }
  113.                 // Fourth Scene
  114.                 public function conclusion():void {
  115.                     manager.current.addCommand(
  116.                                 new RemoveAllChildren( container ),
  117.                                 [
  118.                                         [
  119.                                                 new Prop( scene4_Brother, { x:162, y:266, scaleX:1.5, scaleY:1.5 } ),
  120.                                                 new AddChild( container, scene4_Brother ),
  121.                                                 new DoTweener( scene4_Brother, { x:112, y:216, scaleX:1, scaleY:1, time:4, transition:Equations.easeOutCubic } )
  122.                                         ],
  123.                                         [
  124.                                                 1,
  125.                                                 new Prop( scene4_Sister, { x:416, y:505, scaleX:1.3, scaleY:1.3 } ),
  126.                                                 new AddChild( container, scene4_Sister ),
  127.                                                 new DoTweener( scene4_Sister, { x:316, y:485, scaleX:1, scaleY:1, time:3, transition:Equations.easeOutCubic } )
  128.                                         ],
  129.                                         [
  130.                                                 2,
  131.                                                 new Prop( scene4_Balloon, { rotation:-5, scaleX:0.7, scaleY:0.7 } ),
  132.                                                 new AddChild( container, scene4_Balloon ),
  133.                                                 new DoTweener( scene4_Balloon, { rotation:0, scaleX:1, scaleY:1, time:0.5, transition:Equations.easeOutElastic } )
  134.                                         ],
  135.                                         [
  136.                                                 new AddChild(container2,loader),
  137.                                                 new Prop(loader,{alpha:0}),
  138.                                                 new DoTweener(container, { x:(stage.width / 2) - (container.width * 0.4 ), y:(stage.height / 2) - (container.height * 0.4 ), rotation:0, scaleX:0.4, scaleY:0.4, time:0.5, transition:Equations.easeOutCubic }),
  139.                                                 new DoTweener(sp,        { x:(stage.width / 2) - (container.width * 0.4 ), y:(stage.height / 2) - (container.height * 0.4 ), rotation:0, scaleX:0.4, scaleY:0.4, time:0.5, transition:Equations.easeOutCubic }),
  140.                                                 new DoTweener(loader,   { alpha:1, time:0.5, transition:Equations.easeOutCubic })
  141.                                         ]
  142.                                 ]
  143.                         );
  144.                 }
  145.                 
  146.                 public function loadImg():void {
  147.                     loader = new Loader();
  148.                     loader.load(new URLRequest("http://izm-design.com/temp/checkmate_4_pro.png"));
  149.                 }
  150.                 
  151.                 public function Professional() {
  152.                     CheckmateBuilder.initialize( this );
  153.                             
  154.                     container = new CastSprite();
  155.                     container.graphics.lineStyle(3, 0x000000, 1);
  156.                     container.graphics.drawRect(00320 * 1.45480 * 1.45);
  157.                     container.graphics.endFill();        
  158.                     stage.addChild(container);
  159.                     
  160.                     sp=new Sprite();
  161.                     sp.graphics.beginFill(0x000000,1)
  162.                     sp.graphics.drawRect(00320 * 1.45480 * 1.45);
  163.                     sp.graphics.endFill()
  164.                     
  165.                     stage.addChild(sp);
  166.                     
  167.                     container.mask = sp;
  168.                     container2 = new CastSprite();
  169.                     stage.addChild(container2);
  170.                     loadImg();
  171.                     
  172.                 }
  173.         }
  174. }
  175. import flash.display.*;
  176. import flash.events.*;
  177. import flash.filters.*;
  178. import flash.net.URLRequest;
  179. import flash.system.ApplicationDomain;
  180. import flash.text.*;
  181. import flash.utils.Timer;
  182. import jp.progression.casts.*;
  183. import jp.progression.commands.*;
  184. import jp.progression.commands.lists.*;
  185. import jp.progression.commands.net.*;
  186. import jp.progression.config.*;
  187. import jp.progression.data.*;
  188. import jp.progression.events.*;
  189. import jp.progression.scenes.*;
  190. import jp.progression.*;
  191. import jp.progression.events.*;
  192. class CheckmateBuilder extends EventDispatcher {
  193.         public static var GRAPHICS_URL:String = "http://swf.wonderfl.net/static/assets/checkmate04/ProfessionalAssets.swf";
  194.         private static var _target:Professional;
  195.         private static var _manager:Progression;
  196.         private static var _button:CastButton;
  197.         public static function initialize( target:Professional ):void {
  198.                 if ( _target ) { return; }
  199.                 _target = target;
  200.                 _target.self = target;
  201.                 
  202.                 Progression.initialize( new BasicAppConfig() );
  203.                 _manager = new Progression( "index", _target.stage );
  204.                 var introduction:SceneObject = _manager.root.addScene( new SceneObject( "introduction" ) );
  205.                 var development:SceneObject = _manager.root.addScene( new SceneObject( "development" ) );
  206.                 var turn:SceneObject = _manager.root.addScene( new SceneObject( "turn" ) );
  207.                 var conclusion:SceneObject = _manager.root.addScene( new SceneObject( "conclusion" ) );
  208.                 _manager.root.addEventListener( SceneEvent.SCENE_LOAD, _rootSceneLoad );
  209.                 introduction.addEventListener( SceneEvent.SCENE_INIT, _introduction );
  210.                 development.addEventListener( SceneEvent.SCENE_INIT, _development );
  211.                 turn.addEventListener( SceneEvent.SCENE_INIT, _turn );
  212.                 conclusion.addEventListener( SceneEvent.SCENE_INIT, _conclusion );
  213.                 _target.manager = _manager;
  214.                 _manager.goto( introduction.sceneId );
  215.                 
  216.         }
  217.         private static function _rootSceneLoad( e:SceneEvent ):void {
  218.                 _manager.current.addCommand(
  219.                         new LoadSWF( new URLRequest( GRAPHICS_URL ) ),
  220.                         function():void {
  221.                                 var loader:Loader = Loader( this.latestData );
  222.                                 var domain:ApplicationDomain = loader.contentLoaderInfo.applicationDomain;
  223.                                 _target.scene1_Balloon1 = new ( domain.getDefinition( "scene1.Balloon1" ) as Class );
  224.                                 _target.scene1_Balloon1.x = 106;
  225.                                 _target.scene1_Balloon1.y = 233;
  226.                                 _target.scene1_Balloon2 = new ( domain.getDefinition( "scene1.Balloon2" ) as Class );
  227.                                 _target.scene1_Balloon2.x = 345;
  228.                                 _target.scene1_Balloon2.y = 270;
  229.                                 _target.scene1_Brother = new ( domain.getDefinition( "scene1.Brother" ) as Class );
  230.                                 _target.scene1_Brother.x = 228;
  231.                                 _target.scene1_Brother.y = 335;
  232.                                 _target.scene2_Brother = new ( domain.getDefinition( "scene2.Brother" ) as Class );
  233.                                 _target.scene2_Brother.x = 200;
  234.                                 _target.scene2_Brother.y = 475;
  235.                                 _target.scene2_Shout = new ( domain.getDefinition( "scene2.Shout" ) as Class );
  236.                                 _target.scene2_Shout.x = 240;
  237.                                 _target.scene2_Shout.y = 215;
  238.                                 _target.scene3_Brother = new ( domain.getDefinition( "scene3.Brother" ) as Class );
  239.                                 _target.scene3_Brother.x = 230;
  240.                                 _target.scene3_Brother.y = 348;
  241.                                 _target.scene3_CutIn1 = new ( domain.getDefinition( "scene3.CutIn1" ) as Class );
  242.                                 _target.scene3_CutIn1.x = -226;
  243.                                 _target.scene3_CutIn1.y = -70;
  244.                                 _target.scene3_CutIn2 = new ( domain.getDefinition( "scene3.CutIn2" ) as Class );
  245.                                 _target.scene3_CutIn2.x = -226;
  246.                                 _target.scene3_CutIn2.y = 312;
  247.                                 _target.scene3_SE = new ( domain.getDefinition( "scene3.SE" ) as Class );
  248.                                 _target.scene3_SE.x = 259;
  249.                                 _target.scene3_SE.y = 237;
  250.                                 _target.scene3_Sister = new ( domain.getDefinition( "scene3.Sister" ) as Class );
  251.                                 _target.scene3_Sister.x = 0;
  252.                                 _target.scene3_Sister.y = 387;
  253.                                 _target.scene4_Balloon = new ( domain.getDefinition( "scene4.Balloon" ) as Class );
  254.                                 _target.scene4_Balloon.x = 185;
  255.                                 _target.scene4_Balloon.y = 370;
  256.                                 _target.scene4_Brother = new ( domain.getDefinition( "scene4.Brother" ) as Class );
  257.                                 _target.scene4_Brother.x = 112;
  258.                                 _target.scene4_Brother.y = 216;
  259.                                 _target.scene4_Sister = new ( domain.getDefinition( "scene4.Sister" ) as Class );
  260.                                 _target.scene4_Sister.x = 316;
  261.                                 _target.scene4_Sister.y = 485;
  262.                                 var frameBorder:MovieClip = new ( domain.getDefinition( "ui.FrameBorder" ) as Class );
  263.                                 var nextButton:MovieClip = new ( domain.getDefinition( "ui.NextButton" ) as Class );
  264.                                 nextButton.managerId = "index";
  265.                                 nextButton.x = 435;
  266.                                 nextButton.y = 30;
  267.                                 nextButton.addEventListener( CastMouseEvent.CAST_NAVIGATE_BEFORE, _castNavigateBefore );
  268.                                 var previousButton:MovieClip = new ( domain.getDefinition( "ui.PreviousButton" ) as Class );
  269.                                 previousButton.managerId = "index";
  270.                                 previousButton.x = 30;
  271.                                 previousButton.y = 30;
  272.                                 previousButton.addEventListener( CastMouseEvent.CAST_NAVIGATE_BEFORE, _castNavigateBefore );
  273.                                 _target.stage.addChild( frameBorder );
  274.                                 _target.stage.addChild( nextButton );
  275.                                 _target.stage.addChild( previousButton );
  276.                         }
  277.                 );
  278.         }
  279.         private static function _introduction( e:SceneEvent ):void {
  280.                 _target.introduction();
  281.         }
  282.         private static function _introductionInit( e:SceneEvent ):void {
  283.                 _target.introduction();
  284.         }
  285.         private static function _development( e:SceneEvent ):void {
  286.                 _target.development();
  287.         }
  288.         private static function _turn( e:SceneEvent ):void {
  289.                 _target.turn();
  290.         }
  291.         private static function _conclusion( e:SceneEvent ):void {
  292.                 _target.conclusion();
  293.         }
  294.         private static function _castNavigateBefore( e:CastMouseEvent ):void {
  295.                 _target.manager.stop();
  296.         }
  297. }
flash swf thumbnail play
出題者からのコメント
ストーリーの最後でさらに外の世界観を提示するというのはよくある手法ですが、この場合には閲覧者を限定させることで「落ち」として昇華している好例だと思いました!
ご要望については、必要があれば前向きに検討させて頂きますね!
Comments from King
Though "Reframing the world at the end of story" is well known method, this give good punch line by limiting audience. For about your request, let us think positively, if needed.

Bishopyd_niku

  1. // forked from checkmate's Progression4 Professional
  2. // forked from test_doke's flash on 2009-9-29
  3. package {
  4.         import caurina.transitions.Equations;
  5.         import flash.display.*;
  6.         import jp.progression.commands.*;
  7.         import jp.progression.commands.display.*;
  8.         import jp.progression.commands.lists.*;
  9.         import jp.progression.commands.net.*;
  10.         import jp.progression.commands.tweens.*;
  11.         import jp.progression.*;
  12.         
  13.         import flash.events.*;
  14.         import flash.geom.*;
  15.         import flash.filters.*;
  16.         [SWF( width=465, height=465, backgroundColor=0xFFFFFF, frameRate=30 )]
  17.         public class Professional extends Sprite {
  18.                 public var manager:Progression, self:Professional;
  19.                 // Graphics
  20.                 public var scene1_Balloon1:MovieClip, scene1_Balloon2:MovieClip, scene1_Brother:MovieClip;
  21.                 public var scene2_Brother:MovieClip, scene2_Shout:MovieClip;
  22.                 public var scene3_Brother:MovieClip, scene3_CutIn1:MovieClip, scene3_CutIn2:MovieClip, scene3_SE:MovieClip, scene3_Sister:MovieClip;
  23.                 public var scene4_Balloon:MovieClip, scene4_Brother:MovieClip, scene4_Sister:MovieClip;
  24.                 // First Scene
  25.                 public function introduction():void {
  26.                         manager.current.addCommand(
  27.                                 new RemoveAllChildren( self ),
  28.                                 [
  29.                                         [
  30.                                                 new Prop( scene1_Brother, { y:435 } ),
  31.                                                 new AddChild( self, scene1_Brother ),
  32.                                                 new DoTweener( scene1_Brother, { y:335, time:7 } )
  33.                                         ],
  34.                                         [
  35.                                                 1,
  36.                                                 new Prop( scene1_Balloon1, { alpha:0 } ),
  37.                                                 new AddChild( self, scene1_Balloon1 ),
  38.                                                 new DoTweener( scene1_Balloon1, { alpha:1, time:1 } )
  39.                                         ],
  40.                                         [
  41.                                                 2,
  42.                                                 new Prop( scene1_Balloon2, { alpha:0 } ),
  43.                                                 new AddChild( self, scene1_Balloon2 ),
  44.                                                 new DoTweener( scene1_Balloon2, { alpha:1, time:1 } )
  45.                                         ]
  46.                                 ]
  47.                         );
  48.                 }
  49.                 // Second Scene
  50.                 private var _offsets:Point = new Point;
  51.                 private var _p:Point = new Point;
  52.                 private var _disp:DisplacementMapFilter = new DisplacementMapFilter( nullnew Point, 110100  );
  53.                 public function development():void {
  54.                         var noise:BitmapData = new BitmapData( 465465 );
  55.                         
  56.                         var effect:BitmapData = new BitmapData( 465465 );
  57.                         effect.draw( this );
  58.                         var melt:Function = function (e:Event ):void {
  59.                             _offsets.x += 3;
  60.                             _offsets.y += 3;
  61.                             noise.perlinNoise( 161621falsetrue1false, [ _offsets ]);
  62.                             _disp.mapBitmap = noise;
  63.                             effect.applyFilter( effect, effect.rect, _p, _disp );
  64.                             effect.colorTransform( effect.rect, new ColorTransform(0.90.90.90.9 ) );
  65.                         };
  66.                         var effectContainer:Bitmap = new Bitmap(effect);
  67.                         manager.current.addCommand(
  68.                                 new RemoveAllChildren( self ),
  69.                                 new AddChild( self, effectContainer ),
  70.                                 function():void {
  71.                                     self.addEventListener( Event.ENTER_FRAME, melt );
  72.                                 },
  73.                                 new Wait( 2 ),
  74.                                 function ():void {
  75.                                     self.removeEventListener( Event.ENTER_FRAME, melt );
  76.                                 },
  77.                                 new RemoveChild( self, effectContainer ),
  78.                                 [
  79.                                         [
  80.                                                 new Prop( scene2_Brother, { scaleX:0.3, scaleY:0.3 } ),
  81.                                                 new AddChild( self, scene2_Brother ),
  82.                                                 new DoTweener( scene2_Brother, { scaleX:1, scaleY:1, time:1, transition:Equations.easeOutElastic } )
  83.                                         ],
  84.                                         [
  85.                                                 0.1,
  86.                                                 new Prop( scene2_Shout, { scaleX:0.3, scaleY:0.3 } ),
  87.                                                 new AddChild( self, scene2_Shout ),
  88.                                                 new DoTweener( scene2_Shout, { scaleX:1, scaleY:1, time:1, transition:Equations.easeOutElastic } )
  89.                                         ]
  90.                                 ]
  91.                         );
  92.                 }
  93.                 // Third Scene
  94.                 public function turn():void {
  95.                         var noise:BitmapData = new BitmapData( 465465 );
  96.                         
  97.                         var effect:BitmapData = new BitmapData( 465465 );
  98.                         effect.draw( this );
  99.                         var melt:Function = function (e:Event ):void {
  100.                             _offsets.x += 3;
  101.                             _offsets.y += 3;
  102.                             noise.perlinNoise( 161621falsetrue1false, [ _offsets ]);
  103.                             _disp.mapBitmap = noise;
  104.                             effect.applyFilter( effect, effect.rect, _p, _disp );
  105.                             effect.colorTransform( effect.rect, new ColorTransform(0.90.90.90.9 ) );
  106.                         };
  107.                         var effectContainer:Bitmap = new Bitmap(effect);
  108.                         manager.current.addCommand(
  109.                                 new RemoveAllChildren( self ),
  110.                                 new AddChild( self, effectContainer ),
  111.                                 function():void {
  112.                                     self.addEventListener( Event.ENTER_FRAME, melt );
  113.                                 },
  114.                                 new Wait( 2 ),
  115.                                 function ():void {
  116.                                     self.removeEventListener( Event.ENTER_FRAME, melt );
  117.                                 },
  118.                                 new RemoveChild( self, effectContainer ),
  119.                                 [
  120.                                         [
  121.                                                 new Prop( scene3_Brother, { x:130, scaleX:0.7, scaleY:0.7 } ),
  122.                                                 new AddChild( self, scene3_Brother ),
  123.                                                 new DoTweener( scene3_Brother, { x:230, scaleX:1, scaleY:1, time:1, transition:Equations.easeOutElastic } )
  124.                                         ],
  125.                                         [
  126.                                                 new Prop( scene3_Sister, { x:-300, scaleX:0.7, scaleY:0.7 } ),
  127.                                                 new AddChild( self, scene3_Sister ),
  128.                                                 new DoTweener( scene3_Sister, { x:0, scaleX:1, scaleY:1, time:1, transition:Equations.easeOutElastic } )
  129.                                         ],
  130.                                         new AddChild( self, scene3_CutIn1 ),
  131.                                         new AddChild( self, scene3_CutIn2 ),
  132.                                         [
  133.                                                 new Prop( scene3_SE, { scaleX:0.3, scaleY:0.3 } ),
  134.                                                 new AddChild( self, scene3_SE ),
  135.                                                 new DoTweener( scene3_SE, { scaleX:1, scaleY:1, time:1, transition:Equations.easeOutElastic } )
  136.                                         ]
  137.                                 ]
  138.                         );
  139.                 }
  140.                 // Fourth Scene
  141.                 public function conclusion():void {
  142.                         var noise:BitmapData = new BitmapData( 465465 );
  143.                         
  144.                         var effect:BitmapData = new BitmapData( 465465 );
  145.                         effect.draw( this );
  146.                         var melt:Function = function (e:Event ):void {
  147.                             _offsets.x += 3;
  148.                             _offsets.y += 3;
  149.                             noise.perlinNoise( 161621falsetrue1false, [ _offsets ]);
  150.                             _disp.mapBitmap = noise;
  151.                             effect.applyFilter( effect, effect.rect, _p, _disp );
  152.                             effect.colorTransform( effect.rect, new ColorTransform(0.90.90.90.9 ) );
  153.                         };
  154.                         var effectContainer:Bitmap = new Bitmap(effect);
  155.                         manager.current.addCommand(
  156.                                 new RemoveAllChildren( self ),
  157.                                 new AddChild( self, effectContainer ),
  158.                                 function():void {
  159.                                     self.addEventListener( Event.ENTER_FRAME, melt );
  160.                                 },
  161.                                 new Wait( 2 ),
  162.                                 function ():void {
  163.                                     self.removeEventListener( Event.ENTER_FRAME, melt );
  164.                                 },
  165.                                 new RemoveChild( self, effectContainer ),
  166.                                 [
  167.                                         [
  168.                                                 new Prop( scene4_Brother, { x:162, y:266, scaleX:1.5, scaleY:1.5 } ),
  169.                                                 new AddChild( self, scene4_Brother ),
  170.                                                 new DoTweener( scene4_Brother, { x:112, y:216, scaleX:1, scaleY:1, time:4, transition:Equations.easeOutCubic } )
  171.                                         ],
  172.                                         [
  173.                                                 1,
  174.                                                 new Prop( scene4_Sister, { x:416, y:505, scaleX:1.3, scaleY:1.3 } ),
  175.                                                 new AddChild( self, scene4_Sister ),
  176.                                                 new DoTweener( scene4_Sister, { x:316, y:485, scaleX:1, scaleY:1, time:3, transition:Equations.easeOutCubic } )
  177.                                         ],
  178.                                         [
  179.                                                 2,
  180.                                                 new Prop( scene4_Balloon, { rotation:-5, scaleX:0.7, scaleY:0.7 } ),
  181.                                                 new AddChild( self, scene4_Balloon ),
  182.                                                 new DoTweener( scene4_Balloon, { rotation:0, scaleX:1, scaleY:1, time:0.5, transition:Equations.easeOutElastic } )
  183.                                         ]
  184.                                 ]
  185.                         );
  186.                 }
  187.                 public function Professional() {
  188.                         CheckmateBuilder.initialize( this );
  189.                 }
  190.         }
  191. }
  192. class MeltEffectCommand extends Command {
  193.     private  var effect:BitmapData;
  194.     private  var noise:BitmapData;
  195.     private var offsets:Point = new Point;
  196.     private var p:Point = new Point;
  197.     private var disp:DisplacementMapFilter = new DisplacementMapFilter( nullnew Point, 11050  );
  198.                 
  199.     public function MeltEffectCommand( container:DisplayObject ) {
  200.         noise = new BitmapData( 465465 );
  201.         effect = new BitmapData( 465465 );
  202.         effect.draw( container);
  203.         var effectContainer:Bitmap = new Bitmap(effect);
  204.     }
  205.     private function melt(e:Event ):void {
  206.          offsets.x += 3;
  207.          offsets.y += 3;
  208.          noise.perlinNoise( 161621falsetrue1false, [ offsets ]);
  209.          disp.mapBitmap = noise;
  210.          effect.applyFilter( effect, effect.rect, p, disp );
  211.          effect.colorTransform( effect.rect, new ColorTransform(0.90.90.90.9 ) );
  212.     }
  213.     /*
  214.         new AddChild( self, effectContainer ),
  215.         function():void {
  216.             self.addEventListener( Event.ENTER_FRAME, melt );
  217.         },
  218.         new Wait( 3 ),
  219.         function ():void {]
  220.             self.removeEventListener( Event.ENTER_FRAME, melt );
  221.         },
  222.         new RemoveChild( self, effectContainer ),
  223.     */
  224. }
  225. import flash.display.*;
  226. import flash.events.*;
  227. import flash.geom.*;
  228. import flash.filters.*;
  229. import flash.net.URLRequest;
  230. import flash.system.ApplicationDomain;
  231. import flash.text.*;
  232. import flash.utils.Timer;
  233. import jp.progression.casts.*;
  234. import jp.progression.commands.*;
  235. import jp.progression.commands.lists.*;
  236. import jp.progression.commands.net.*;
  237. import jp.progression.config.*;
  238. import jp.progression.data.*;
  239. import jp.progression.events.*;
  240. import jp.progression.scenes.*;
  241. import jp.progression.*;
  242. class CheckmateBuilder extends EventDispatcher {
  243.         public static var GRAPHICS_URL:String = "http://swf.wonderfl.net/static/assets/checkmate04/ProfessionalAssets.swf";
  244.         private static var _target:Professional;
  245.         private static var _manager:Progression;
  246.         private static var _button:CastButton;
  247.         public static function initialize( target:Professional ):void {
  248.                 if ( _target ) { return; }
  249.                 _target = target;
  250.                 _target.self = target;
  251.                 Progression.initialize( new BasicAppConfig() );
  252.                 _manager = new Progression( "index", _target.stage );
  253.                 var introduction:SceneObject = _manager.root.addScene( new SceneObject( "introduction" ) );
  254.                 var development:SceneObject = _manager.root.addScene( new SceneObject( "development" ) );
  255.                 var turn:SceneObject = _manager.root.addScene( new SceneObject( "turn" ) );
  256.                 var conclusion:SceneObject = _manager.root.addScene( new SceneObject( "conclusion" ) );
  257.                 _manager.root.addEventListener( SceneEvent.SCENE_LOAD, _rootSceneLoad );
  258.                 introduction.addEventListener( SceneEvent.SCENE_INIT, _introduction );
  259.                 development.addEventListener( SceneEvent.SCENE_INIT, _development );
  260.                 turn.addEventListener( SceneEvent.SCENE_INIT, _turn );
  261.                 conclusion.addEventListener( SceneEvent.SCENE_INIT, _conclusion );
  262.                 _target.manager = _manager;
  263.                 _manager.goto( introduction.sceneId );
  264.         }
  265.         private static function _rootSceneLoad( e:SceneEvent ):void {
  266.                 _manager.current.addCommand(
  267.                         new LoadSWF( new URLRequest( GRAPHICS_URL ) ),
  268.                         function():void {
  269.                                 var loader:Loader = Loader( this.latestData );
  270.                                 var domain:ApplicationDomain = loader.contentLoaderInfo.applicationDomain;
  271.                                 _target.scene1_Balloon1 = new ( domain.getDefinition( "scene1.Balloon1" ) as Class );
  272.                                 _target.scene1_Balloon1.x = 106;
  273.                                 _target.scene1_Balloon1.y = 233;
  274.                                 _target.scene1_Balloon2 = new ( domain.getDefinition( "scene1.Balloon2" ) as Class );
  275.                                 _target.scene1_Balloon2.x = 345;
  276.                                 _target.scene1_Balloon2.y = 270;
  277.                                 _target.scene1_Brother = new ( domain.getDefinition( "scene1.Brother" ) as Class );
  278.                                 _target.scene1_Brother.x = 228;
  279.                                 _target.scene1_Brother.y = 335;
  280.                                 _target.scene2_Brother = new ( domain.getDefinition( "scene2.Brother" ) as Class );
  281.                                 _target.scene2_Brother.x = 200;
  282.                                 _target.scene2_Brother.y = 475;
  283.                                 _target.scene2_Shout = new ( domain.getDefinition( "scene2.Shout" ) as Class );
  284.                                 _target.scene2_Shout.x = 240;
  285.                                 _target.scene2_Shout.y = 215;
  286.                                 _target.scene3_Brother = new ( domain.getDefinition( "scene3.Brother" ) as Class );
  287.                                 _target.scene3_Brother.x = 230;
  288.                                 _target.scene3_Brother.y = 348;
  289.                                 _target.scene3_CutIn1 = new ( domain.getDefinition( "scene3.CutIn1" ) as Class );
  290.                                 _target.scene3_CutIn1.x = -226;
  291.                                 _target.scene3_CutIn1.y = -70;
  292.                                 _target.scene3_CutIn2 = new ( domain.getDefinition( "scene3.CutIn2" ) as Class );
  293.                                 _target.scene3_CutIn2.x = -226;
  294.                                 _target.scene3_CutIn2.y = 312;
  295.                                 _target.scene3_SE = new ( domain.getDefinition( "scene3.SE" ) as Class );
  296.                                 _target.scene3_SE.x = 259;
  297.                                 _target.scene3_SE.y = 237;
  298.                                 _target.scene3_Sister = new ( domain.getDefinition( "scene3.Sister" ) as Class );
  299.                                 _target.scene3_Sister.x = 0;
  300.                                 _target.scene3_Sister.y = 387;
  301.                                 _target.scene4_Balloon = new ( domain.getDefinition( "scene4.Balloon" ) as Class );
  302.                                 _target.scene4_Balloon.x = 185;
  303.                                 _target.scene4_Balloon.y = 370;
  304.                                 _target.scene4_Brother = new ( domain.getDefinition( "scene4.Brother" ) as Class );
  305.                                 _target.scene4_Brother.x = 112;
  306.                                 _target.scene4_Brother.y = 216;
  307.                                 _target.scene4_Sister = new ( domain.getDefinition( "scene4.Sister" ) as Class );
  308.                                 _target.scene4_Sister.x = 316;
  309.                                 _target.scene4_Sister.y = 485;
  310.                                 var frameBorder:MovieClip = new ( domain.getDefinition( "ui.FrameBorder" ) as Class );
  311.                                 var nextButton:MovieClip = new ( domain.getDefinition( "ui.NextButton" ) as Class );
  312.                                 nextButton.managerId = "index";
  313.                                 nextButton.x = 435;
  314.                                 nextButton.y = 30;
  315.                                 nextButton.addEventListener( CastMouseEvent.CAST_NAVIGATE_BEFORE, _castNavigateBefore );
  316.                                 var previousButton:MovieClip = new ( domain.getDefinition( "ui.PreviousButton" ) as Class );
  317.                                 previousButton.managerId = "index";
  318.                                 previousButton.x = 30;
  319.                                 previousButton.y = 30;
  320.                                 previousButton.addEventListener( CastMouseEvent.CAST_NAVIGATE_BEFORE, _castNavigateBefore );
  321.                                 _target.stage.addChild( frameBorder );
  322.                                 _target.stage.addChild( nextButton );
  323.                                 _target.stage.addChild( previousButton );
  324.                         }
  325.                 );
  326.         }
  327.         private static function _introduction( e:SceneEvent ):void {
  328.                 _target.introduction();
  329.         }
  330.         private static function _introductionInit( e:SceneEvent ):void {
  331.                 _target.introduction();
  332.         }
  333.         private static function _development( e:SceneEvent ):void {
  334.                 _target.development();
  335.         }
  336.         private static function _turn( e:SceneEvent ):void {
  337.                 _target.turn();
  338.         }
  339.         private static function _conclusion( e:SceneEvent ):void {
  340.                 _target.conclusion();
  341.         }
  342.         private static function _castNavigateBefore( e:CastMouseEvent ):void {
  343.                 _target.manager.stop();
  344.         }
  345. }
flash swf thumbnail play
出題者からのコメント
紙媒体でのマンガ表現には、遷移時のエフェクトという概念が存在しないので、この辺りというのは今後発展の可能性がありそうですね!
Comments from King
Paper printed cartoon cannot have effect on frame transition. It seems to have more to explore.

ad