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


embed

FORKED
  1. // forked from clockmaker's 3D Carousel
  2. // Flash 10 で被写界深度ネタ Z-sortつき
  3. package{
  4.   import flash.display.*
  5.   import flash.events.*
  6.   import flash.filters.BlurFilter;
  7.   import flash.geom.*;
  8.   
  9.   [SWF(frameRate="90", width="465", height="465")]
  10.   public class Main extends Sprite {
  11.   public function Main() {
  12.       
  13.       var main :Sprite = Sprite(addChild(new Sprite()))
  14.       main.x = stage.stageWidth / 2
  15.       main.y = stage.stageHeight / 2
  16.       var wrap :Sprite = Sprite(main.addChild(new Sprite()))
  17.       
  18.       var pp:PerspectiveProjection = root.transform.perspectiveProjection; 
  19.       
  20.       var objs:Array = []
  21.       for(var i:int=0; i<30; i++)
  22.       {
  23.         var sp: Sprite = Sprite(wrap.addChild(new Sprite()))
  24.         sp.graphics.beginFill(0xFFFFFF * Math.random())
  25.         sp.graphics.drawRect(-25, -255050)
  26.         sp.x = 200 * Math.sin( i * 360 / 10 * Math.PI / 180)
  27.         sp.z = 200 * Math.cos( i * 360 / 10 * Math.PI / 180)
  28.         sp.y = 20*i;
  29.               
  30.         objs.push(sp)
  31.       }
  32.       
  33.       stage.addEventListener(Event.ENTER_FRAME, function(e:Event):void
  34.       {
  35.         pp.projectionCenter = new Point(stage.stageWidth / 2,
  36.                   stage.stageHeight / 2 - 100)
  37.         
  38.         wrap.rotationY += (mouseX / stage.stageWidth * 480 - wrap.rotationY) * 0.05
  39.         wrap.rotationY += (mouseY / stage.stageHeight * 480 - wrap.rotationY) * 0.1
  40.         
  41.         var arr:Array = []
  42.         for (var i:int=0; i<objs.length; i++) {
  43.           var ele:Sprite = objs[i] as Sprite
  44.           ele.rotationY = -wrap.rotationY
  45.           var mtx:Matrix3D = ele.transform.getRelativeMatrix3D(main)
  46.           arr.push( { ele:ele, z:mtx.position.z } )
  47.         }
  48.         arr.sortOn("z"Array.NUMERIC | Array.DESCENDING)
  49.         var baseZ:Number = wrap.z
  50.         for (i=0; i<arr.length; i++) {
  51.           ele = arr[i].ele as Sprite
  52.           var z:Number = arr[i].z
  53.           wrap.setChildIndex(ele, i)
  54.           var b:Number = Math.abs(z)
  55.           
  56.           // focus depth blur effect, warning, very slow:
  57.           b = z/10
  58.           ele.filters = (b > 2) ? [new BlurFilter(b, b, 3)] : []
  59.         }
  60.       })
  61.     }
  62.   }
  63. }
noswf
  1. // forked from clockmaker's 3D Carousel
  2. // Flash 10 で被写界深度ネタ Z-sortつき
  3. package{
  4.   import flash.display.*
  5.   import flash.events.*
  6.   import flash.filters.BlurFilter;
  7.   import flash.geom.*;
  8.   
  9.   [SWF(frameRate="90", width="465", height="465")]
  10.   public class Main extends Sprite {
  11.   public function Main() {
  12.       
  13.       var main :Sprite = Sprite(addChild(new Sprite()))
  14.       main.x = stage.stageWidth / 2
  15.       main.y = stage.stageHeight / 2
  16.       var wrap :Sprite = Sprite(main.addChild(new Sprite()))
  17.       
  18.       var pp:PerspectiveProjection = root.transform.perspectiveProjection; 
  19.       
  20.       var objs:Array = []
  21.       for(var i:int=0; i<15; i++)
  22.       {
  23.         var sp: Sprite = Sprite(wrap.addChild(new Sprite()))
  24.         sp.graphics.beginFill(0xFFFFFF * Math.random())
  25.         sp.graphics.drawRect(-25, -255050)
  26.         sp.x = 200 * Math.sin( i * 360 / 15 * Math.PI / 180)
  27.         sp.z = 200 * Math.cos( i * 360 / 15 * Math.PI / 180)
  28.         
  29.         objs.push(sp)
  30.       }
  31.       
  32.       stage.addEventListener(Event.ENTER_FRAME, function(e:Event):void
  33.       {
  34.         pp.projectionCenter = new Point(stage.stageWidth / 2,
  35.                   stage.stageHeight / 2 - 100)
  36.         
  37.         wrap.rotationY += (mouseX / stage.stageWidth * 480 - wrap.rotationY) * 0.05
  38.         
  39.         var arr:Array = []
  40.         for (var i:int=0; i<objs.length; i++) {
  41.           var ele:Sprite = objs[i] as Sprite
  42.           ele.rotationY = -wrap.rotationY
  43.           var mtx:Matrix3D = ele.transform.getRelativeMatrix3D(main)
  44.           arr.push( { ele:ele, z:mtx.position.z } )
  45.         }
  46.         arr.sortOn("z"Array.NUMERIC | Array.DESCENDING)
  47.         var baseZ:Number = wrap.z
  48.         for (i=0; i<arr.length; i++) {
  49.           ele = arr[i].ele as Sprite
  50.           var z:Number = arr[i].z
  51.           wrap.setChildIndex(ele, i)
  52.           var b:Number = Math.abs(z)
  53.           
  54.           // focus depth blur effect, warning, very slow:
  55.           b = z/10
  56.           ele.filters = (b > 2) ? [new BlurFilter(b, b, 3)] : []
  57.         }
  58.       })
  59.     }
  60.   }
  61. }
noswf
  1. package{
  2.   import flash.display.*
  3.   import flash.events.*
  4.   import flash.filters.BlurFilter;
  5.   import flash.geom.*;
  6.   
  7.   [SWF(frameRate="90", width="465", height="465")]
  8.   public class Main extends Sprite {
  9.   public function Main() {
  10.       
  11.       var main :Sprite = Sprite(addChild(new Sprite()))
  12.       main.x = stage.stageWidth / 2
  13.       main.y = stage.stageHeight / 2
  14.       var wrap :Sprite = Sprite(main.addChild(new Sprite()))
  15.       
  16.       var pp:PerspectiveProjection = root.transform.perspectiveProjection; 
  17.       
  18.       var objs:Array = []
  19.       for(var i:int=0; i<15; i++)
  20.       {
  21.         var sp: Sprite = Sprite(wrap.addChild(new Sprite()))
  22.         sp.graphics.beginFill(0x0ffffff * Math.random())
  23.         sp.graphics.drawRect(-25, -255050)
  24.         sp.x = 200* Math.sin( i * 360/15 * Math.PI / 180)
  25.         sp.z = 200 * Math.cos( i * 360 / 15 * Math.PI / 180)
  26.         
  27.         objs.push(sp)
  28.       }
  29.       
  30.       stage.addEventListener(Event.ENTER_FRAME, function(e:Event):void
  31.       {
  32.         pp.projectionCenter = new Point(stage.stageWidth / 2,
  33.                   stage.stageHeight / 2 -100)
  34.         
  35.         wrap.rotationY += (mouseX / stage.stageWidth * 480 - wrap.rotationY) * 0.05
  36.         
  37.         var arr:Array = []
  38.         for (var i:int=0; i<objs.length; i++) {
  39.           var ele:Sprite = objs[i] as Sprite
  40.           ele.rotationY = -wrap.rotationY
  41.           var mtx:Matrix3D = ele.transform.getRelativeMatrix3D(main)
  42.           arr.push( { ele:ele, z:mtx.position} )
  43.         }
  44.         arr.sortOn("z"Array.NUMERIC | Array.DESCENDING)
  45.         var baseZ:Number = wrap.z
  46.         for (i=0; i<arr.length; i++) {
  47.           ele = arr[i].ele as Sprite
  48.           var z:Number = arr[i].z
  49.           wrap.setChildIndex(ele, i)
  50.           var b:Number = Math.abs(z)
  51.           
  52.           // focus depth blur effect, warning, very slow:
  53.           b = z/10
  54.           ele.filters = (b > 2) ? [new BlurFilter(b, b, 3)] : []
  55.         }
  56.       })
  57.     }
  58.   }
  59. }
noswf
  1. // forked from clockmaker's 3D Carousel
  2. // Flash 10 で被写界深度ネタ Z-sortつき
  3. package{
  4.   import flash.display.*
  5.   import flash.events.*
  6.   import flash.filters.BlurFilter;
  7.   import flash.geom.*;
  8.   
  9.   [SWF(frameRate="90", width="500", height="465")]
  10.   public class Main extends Sprite {
  11.   public function Main() {
  12.       
  13.       var main :Sprite = Sprite(addChild(new Sprite()))
  14.       main.x = stage.stageWidth / 2
  15.       main.y = stage.stageHeight / 2.5
  16.       var wrap :Sprite = Sprite(main.addChild(new Sprite()))
  17.       
  18.       var pp:PerspectiveProjection = root.transform.perspectiveProjection; 
  19.       
  20.       var objs:Array = []
  21.       for(var i:int=0; i<15; i++)
  22.       {
  23.         var sp: Sprite = Sprite(wrap.addChild(new Sprite()))
  24.         sp.graphics.beginFill(0xFFFFFF * Math.random())
  25.         sp.graphics.drawRect(-25, -255050)
  26.         sp.x = 200 * Math.sin( i * 360 / 15 * Math.PI / 180)
  27.         sp.z = 200 * Math.cos( i * 360 / 15 * Math.PI / 180)
  28.         
  29.         objs.push(sp)
  30.       }
  31.       
  32.       stage.addEventListener(Event.ENTER_FRAME, function(e:Event):void
  33.       {
  34.         pp.projectionCenter = new Point(stage.stageWidth / 2,
  35.                   stage.stageHeight / 2 - 150)
  36.         
  37.         wrap.rotationY += (mouseX / stage.stageWidth * 480 - wrap.rotationY) * 0.05
  38.         
  39.         var arr:Array = []
  40.         for (var i:int=0; i<objs.length; i++) {
  41.           var ele:Sprite = objs[i] as Sprite
  42.           ele.rotationY = -wrap.rotationY
  43.           var mtx:Matrix3D = ele.transform.getRelativeMatrix3D(main)
  44.           arr.push( { ele:ele, z:mtx.position.z } )
  45.         }
  46.         arr.sortOn("z"Array.NUMERIC | Array.DESCENDING)
  47.         var baseZ:Number = wrap.z
  48.         for (i=0; i<arr.length; i++) {
  49.           ele = arr[i].ele as Sprite
  50.           var z:Number = arr[i].z
  51.           wrap.setChildIndex(ele, i)
  52.           var b:Number = Math.abs(z)
  53.           
  54.           // focus depth blur effect, warning, very slow:
  55.           b = z/10
  56.           ele.filters = (b > 2) ? [new BlurFilter(b, b, 3)] : []
  57.         }
  58.       })
  59.     }
  60.   }
  61. }
noswf
  1. // forked from clockmaker's 3D Carousel
  2. // Flash 10 で被写界深度ネタ Z-sortつき
  3. package{
  4.   import flash.display.*
  5.   import flash.events.*
  6.   import flash.filters.BlurFilter;
  7.   import flash.geom.*;
  8.   
  9.   [SWF(frameRate="30", width="800", height="465")]
  10.   public class Main extends Sprite {
  11.   public function Main() {
  12.       
  13.       var main :Sprite = Sprite(addChild(new Sprite()))
  14.       main.x = stage.stageWidth / 2
  15.       main.y = stage.stageHeight / 2
  16.       var wrap :Sprite = Sprite(main.addChild(new Sprite()))
  17.       
  18.       var pp:PerspectiveProjection = root.transform.perspectiveProjection; 
  19.       
  20.       var objs:Array = []
  21.       for(var i:int=0; i<15; i++)
  22.       {
  23.         var sp: Sprite = Sprite(wrap.addChild(new Sprite()))
  24.         sp.graphics.beginFill(0xFFFFFF * Math.random())
  25.         sp.graphics.drawRect(-25, -255050)
  26.         sp.x = 200 * Math.sin( i * 360 / 15 * Math.PI / 180)
  27.         sp.z = 200 * Math.cos( i * 360 / 15 * Math.PI / 180)
  28.         
  29.         objs.push(sp)
  30.       }
  31.       
  32.       stage.addEventListener(Event.ENTER_FRAME, function(e:Event):void
  33.       {
  34.         pp.projectionCenter = new Point(stage.stageWidth / 2,
  35.                   stage.stageHeight / 2 - 100)
  36.         
  37.         wrap.rotationY += (mouseX / stage.stageWidth * 480 - wrap.rotationY) * 0.05
  38.         
  39.         var arr:Array = []
  40.         for (var i:int=0; i<objs.length; i++) {
  41.           var ele:Sprite = objs[i] as Sprite
  42.           ele.rotationY = -wrap.rotationY
  43.           var mtx:Matrix3D = ele.transform.getRelativeMatrix3D(main)
  44.           arr.push( { ele:ele, z:mtx.position.z } )
  45.         }
  46.         arr.sortOn("z"Array.NUMERIC | Array.DESCENDING)
  47.         var baseZ:Number = wrap.z
  48.         for (i=0; i<arr.length; i++) {
  49.           ele = arr[i].ele as Sprite
  50.           var z:Number = arr[i].z
  51.           wrap.setChildIndex(ele, i)
  52.           var b:Number = Math.abs(z)
  53.           
  54.           // focus depth blur effect, warning, very slow:
  55.           b = z/10
  56.           ele.filters = (b > 2) ? [new BlurFilter(b, b, 3)] : []
  57.         }
  58.       })
  59.     }
  60.   }
  61. }
noswf
Get Adobe Flash Player