※現在、「wonderfl build flash online」求人コンテンツ制作に関してのアンケートを実施中です!みなさまのお力添えを頂いて、続々とアンケート結果が集まっていますが、まだまだ募集しております。ご協力のほど、どうぞよろしくお願いいたします!
wonderfl運営事務局
→アンケートページ(※ログインしてからお答えいただけるようになっています。)
らせん階段を上ります。 forked from: らせん階段を上ります。
- // forked from sake's らせん階段を上ります。
- /*
- らせん階段を上ります。
- 定数kの値でジャンプする高さを変更できます。
- */
- package
- {
- import flash.display.Graphics;
- import flash.display.Sprite;
- import flash.display.StageQuality;
- import flash.events.Event;
- import flash.geom.Matrix3D;
- [SWF(width="465", height="465", backgroundColor="0xFFFFFF", frameRate="30")]
- public class spiral extends Sprite
- {
- private var container:Sprite;
- private var cube:Sprite;
- private var nn:int;
- private var xx:Number;
- private var ss:Number;
- // ジャンプする度合いを決める定数
- private const k:Number=10;
- public function spiral()
- {
- container=new Sprite();
- container.x=465 / 2;
- container.y=465 / 2;
- addChild(container);
- container.scaleX=container.scaleY=container.scaleZ=0.15;
- nn=xx=ss=0;
- cube=new Sprite;
- container.addChild(cube);
- cube.name="sp" + nn.toString();
- nn++;
- var sp0:Sprite=new Sprite();
- draw(sp0.graphics);
- sp0.rotationY=90;
- sp0.x=50;
- cube.addChild(sp0);
- sp0.name="plane0";
- var sp1:Sprite=new Sprite();
- draw(sp1.graphics);
- sp1.rotationY=-90;
- sp1.x=-50;
- cube.addChild(sp1);
- sp1.name="plane1";
- var sp2:Sprite=new Sprite();
- draw(sp2.graphics);
- sp2.rotationX=-90;
- sp2.y=-50;
- cube.addChild(sp2);
- sp2.name="plane2";
- var sp3:Sprite=new Sprite();
- draw(sp3.graphics);
- sp3.rotationX=90;
- sp3.y=50;
- cube.addChild(sp3);
- sp3.name="plane3";
- var sp4:Sprite=new Sprite();
- draw(sp4.graphics);
- sp4.z=-50;
- cube.addChild(sp4);
- sp4.name="plane4";
- var sp5:Sprite=new Sprite();
- draw(sp5.graphics);
- sp5.z=50;
- cube.addChild(sp5);
- sp5.name="plane5";
- var h:int=-50;
- var s:Number=0;
- for(var i:int=0; i < 140; i++)
- {
- var sp6:Sprite=new Sprite;
- sp6.graphics.beginFill(0x00FF00, 0.3);
- sp6.graphics.drawRect(-50, -50, 100, 100);
- sp6.graphics.endFill();
- container.addChild(sp6);
- sp6.name="sp" + nn.toString();
- nn++;
- sp6.rotationX=90;
- sp6.y=-h;
- h+=10;
- sp6.x=1.1 * s * Math.cos(s * Math.PI / 180);
- sp6.z=1.1 * s * Math.sin(s * Math.PI / 180);
- s+=20;
- }
- container.rotationX=50;
- container.rotationY=40;
- addEventListener(Event.ENTER_FRAME, onFrame);
- }
- private function draw(g:Graphics):void
- {
- g.beginFill(0xFFFFFF * Math.random(), 0.7);
- g.drawRect(-50, -50, 100, 100);
- g.endFill();
- }
- private function onFrame(e:Event):void
- {
- cube.z=1.1 * ss * Math.sin(ss * Math.PI / 180);
- cube.x=1.1 * ss * Math.cos(ss * Math.PI / 180);
- cube.y=-10 * (-1 * (2 * k - 1 + 2 * Math.sqrt(k * k - k)) * (xx - k + Math.sqrt(k * k - k) - Math.floor(xx)) * (xx - k + Math.sqrt(k * k - k) - Math.floor(xx)) + k + Math.floor(xx));
- xx+=0.05;
- ss+=1;
- var array:Array=[];
- for(var i:int=0; i < 6; i++)
- {
- var sp:Sprite=cube.getChildByName("plane" + i.toString())as Sprite;
- var mat:Matrix3D=sp.transform.getRelativeMatrix3D(this);
- array.push({sp:sp, z:mat.position.z});
- }
- array.sortOn("z", Array.NUMERIC | Array.DESCENDING);
- for(var i:int=0; i < 6; i++)
- {
- var sp:Sprite=array[i].sp as Sprite;
- cube.setChildIndex(sp, i);
- }
- array=[];
- for(var i:int=0; i < nn; i++)
- {
- var sp:Sprite=container.getChildByName("sp" + i.toString())as Sprite;
- var mat:Matrix3D=sp.transform.getRelativeMatrix3D(this);
- array.push({sp:sp, z:mat.position.z});
- }
- array.sortOn("z", Array.NUMERIC | Array.DESCENDING);
- for(var i:int=0; i < nn; i++)
- {
- var sp:Sprite=array[i].sp as Sprite;
- container.setChildIndex(sp, i);
- }
- }
- }
- }
らせん階段を上ります。 forked from: らせん階段を上ります。
- // forked from sake's らせん階段を上ります。
- /*
- らせん階段を上ります。
- 定数kの値でジャンプする高さを変更できます。
- */
- package
- {
- import flash.display.Graphics;
- import flash.display.Sprite;
- import flash.display.StageQuality;
- import flash.events.Event;
- import flash.geom.Matrix3D;
- [SWF(width="465", height="465", backgroundColor="0xFFFFFF", frameRate="30")]
- public class spiral extends Sprite
- {
- private var container:Sprite;
- private var cube:Sprite;
- private var nn:int;
- private var xx:Number;
- private var ss:Number;
- // ジャンプする度合いを決める定数
- private const k:Number=10;
- public function spiral()
- {
- container=new Sprite();
- container.x=465 / 2;
- container.y=465 / 2;
- addChild(container);
- container.scaleX=container.scaleY=container.scaleZ=0.15;
- nn=xx=ss=0;
- cube=new Sprite;
- container.addChild(cube);
- cube.name="sp" + nn.toString();
- nn++;
- var sp0:Sprite=new Sprite();
- draw(sp0.graphics);
- sp0.rotationY=90;
- sp0.x=50;
- cube.addChild(sp0);
- sp0.name="plane0";
- var sp1:Sprite=new Sprite();
- draw(sp1.graphics);
- sp1.rotationY=-90;
- sp1.x=-50;
- cube.addChild(sp1);
- sp1.name="plane1";
- var sp2:Sprite=new Sprite();
- draw(sp2.graphics);
- sp2.rotationX=-90;
- sp2.y=-50;
- cube.addChild(sp2);
- sp2.name="plane2";
- var sp3:Sprite=new Sprite();
- draw(sp3.graphics);
- sp3.rotationX=90;
- sp3.y=50;
- cube.addChild(sp3);
- sp3.name="plane3";
- var sp4:Sprite=new Sprite();
- draw(sp4.graphics);
- sp4.z=-50;
- cube.addChild(sp4);
- sp4.name="plane4";
- var sp5:Sprite=new Sprite();
- draw(sp5.graphics);
- sp5.z=50;
- cube.addChild(sp5);
- sp5.name="plane5";
- var h:int=-50;
- var s:Number=0;
- for(var i:int=0; i < 140; i++)
- {
- var sp6:Sprite=new Sprite;
- sp6.graphics.beginFill(0x00FF00, 0.3);
- sp6.graphics.drawRect(-50, -50, 100, 100);
- sp6.graphics.endFill();
- container.addChild(sp6);
- sp6.name="sp" + nn.toString();
- nn++;
- sp6.rotationX=90;
- sp6.y=-h;
- h+=10;
- sp6.x=1.1 * s * Math.cos(s * Math.PI / 180);
- sp6.z=1.1 * s * Math.sin(s * Math.PI / 180);
- s+=20;
- }
- container.rotationX=50;
- container.rotationY=40;
- addEventListener(Event.ENTER_FRAME, onFrame);
- }
- private function draw(g:Graphics):void
- {
- g.beginFill(0xFFFFFF * Math.random(), 0.7);
- g.drawRect(-50, -50, 100, 100);
- g.endFill();
- }
- private function onFrame(e:Event):void
- {
- cube.z=1.1 * ss * Math.sin(ss * Math.PI / 180);
- cube.x=1.1 * ss * Math.cos(ss * Math.PI / 180);
- cube.y=-10 * (-1 * (2 * k - 1 + 2 * Math.sqrt(k * k - k)) * (xx - k + Math.sqrt(k * k - k) - Math.floor(xx)) * (xx - k + Math.sqrt(k * k - k) - Math.floor(xx)) + k + Math.floor(xx));
- xx+=0.05;
- ss+=1;
- var array:Array=[];
- for(var i:int=0; i < 6; i++)
- {
- var sp:Sprite=cube.getChildByName("plane" + i.toString())as Sprite;
- var mat:Matrix3D=sp.transform.getRelativeMatrix3D(this);
- array.push({sp:sp, z:mat.position.z});
- }
- array.sortOn("z", Array.NUMERIC | Array.DESCENDING);
- for(var i:int=0; i < 6; i++)
- {
- var sp:Sprite=array[i].sp as Sprite;
- cube.setChildIndex(sp, i);
- }
- array=[];
- for(var i:int=0; i < nn; i++)
- {
- var sp:Sprite=container.getChildByName("sp" + i.toString())as Sprite;
- var mat:Matrix3D=sp.transform.getRelativeMatrix3D(this);
- array.push({sp:sp, z:mat.position.z});
- }
- array.sortOn("z", Array.NUMERIC | Array.DESCENDING);
- for(var i:int=0; i < nn; i++)
- {
- var sp:Sprite=array[i].sp as Sprite;
- container.setChildIndex(sp, i);
- }
- }
- }
- }
らせん階段を上ります。 forked from: らせん階段を上ります。
- // forked from sake's らせん階段を上ります。
- /*
- らせん階段を上ります。
- 定数kの値でジャンプする高さを変更できます。
- */
- package
- {
- import flash.display.Graphics;
- import flash.display.Sprite;
- import flash.display.StageQuality;
- import flash.events.Event;
- import flash.geom.Matrix3D;
- [SWF(width="465", height="465", backgroundColor="0xFFFFFF", frameRate="30")]
- public class spiral extends Sprite
- {
- private var container:Sprite;
- private var cube:Sprite;
- private var nn:int;
- private var xx:Number;
- private var ss:Number;
- // ジャンプする度合いを決める定数
- private const k:Number=15;
- public function spiral()
- {
- container=new Sprite();
- container.x=465 / 2;
- container.y=465 / 2;
- addChild(container);
- container.scaleX=container.scaleY=container.scaleZ=0.15;
- nn=xx=ss=0;
- cube=new Sprite;
- container.addChild(cube);
- cube.name="sp" + nn.toString();
- nn++;
- var sp0:Sprite=new Sprite();
- draw(sp0.graphics);
- sp0.rotationY=90;
- sp0.x=50;
- cube.addChild(sp0);
- sp0.name="plane0";
- var sp1:Sprite=new Sprite();
- draw(sp1.graphics);
- sp1.rotationY=-90;
- sp1.x=-50;
- cube.addChild(sp1);
- sp1.name="plane1";
- var sp2:Sprite=new Sprite();
- draw(sp2.graphics);
- sp2.rotationX=-90;
- sp2.y=-50;
- cube.addChild(sp2);
- sp2.name="plane2";
- var sp3:Sprite=new Sprite();
- draw(sp3.graphics);
- sp3.rotationX=90;
- sp3.y=50;
- cube.addChild(sp3);
- sp3.name="plane3";
- var sp4:Sprite=new Sprite();
- draw(sp4.graphics);
- sp4.z=-50;
- cube.addChild(sp4);
- sp4.name="plane4";
- var sp5:Sprite=new Sprite();
- draw(sp5.graphics);
- sp5.z=50;
- cube.addChild(sp5);
- sp5.name="plane5";
- var h:int=-50;
- var s:Number=0;
- for(var i:int=0; i < 140; i++)
- {
- var sp6:Sprite=new Sprite;
- sp6.graphics.beginFill(0x00FF00, 0.3);
- sp6.graphics.drawRect(-50, -50, 100, 100);
- sp6.graphics.endFill();
- container.addChild(sp6);
- sp6.name="sp" + nn.toString();
- nn++;
- sp6.rotationX=90;
- sp6.y=-h;
- h+=10;
- sp6.x=1.1 * s * Math.cos(s * Math.PI / 180);
- sp6.z=1.1 * s * Math.sin(s * Math.PI / 180);
- s+=20;
- }
- container.rotationX=50;
- container.rotationY=40;
- addEventListener(Event.ENTER_FRAME, onFrame);
- }
- private function draw(g:Graphics):void
- {
- g.beginFill(0xFFFFFF * Math.random(), 0.7);
- g.drawRect(-50, -50, 100, 100);
- g.endFill();
- }
- private function onFrame(e:Event):void
- {
- cube.z=1.1 * ss * Math.sin(ss * Math.PI / 180);
- cube.x=1.1 * ss * Math.cos(ss * Math.PI / 180);
- cube.y=-10 * (-1 * (2 * k - 1 + 2 * Math.sqrt(k * k - k)) * (xx - k + Math.sqrt(k * k - k) - Math.floor(xx)) * (xx - k + Math.sqrt(k * k - k) - Math.floor(xx)) + k + Math.floor(xx));
- xx+=0.05;
- ss+=1;
- var array:Array=[];
- for(var i:int=0; i < 6; i++)
- {
- var sp:Sprite=cube.getChildByName("plane" + i.toString())as Sprite;
- var mat:Matrix3D=sp.transform.getRelativeMatrix3D(this);
- array.push({sp:sp, z:mat.position.z});
- }
- array.sortOn("z", Array.NUMERIC | Array.DESCENDING);
- for(var i:int=0; i < 6; i++)
- {
- var sp:Sprite=array[i].sp as Sprite;
- cube.setChildIndex(sp, i);
- }
- array=[];
- for(var i:int=0; i < nn; i++)
- {
- var sp:Sprite=container.getChildByName("sp" + i.toString())as Sprite;
- var mat:Matrix3D=sp.transform.getRelativeMatrix3D(this);
- array.push({sp:sp, z:mat.position.z});
- }
- array.sortOn("z", Array.NUMERIC | Array.DESCENDING);
- for(var i:int=0; i < nn; i++)
- {
- var sp:Sprite=array[i].sp as Sprite;
- container.setChildIndex(sp, i);
- }
- }
- }
- }
notice:



