In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

ごぉぉぉぉおお

Get Adobe Flash player
by Kihara 24 Feb 2011
/**
 * Copyright Kihara ( http://wonderfl.net/user/Kihara )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/1gzA
 */

package
{
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.events.Event;
    
    import org.papervision3d.materials.ColorMaterial;
    import org.papervision3d.materials.WireframeMaterial;
    import org.papervision3d.materials.special.CompositeMaterial;
    import org.papervision3d.materials.utils.MaterialsList;
    import org.papervision3d.view.BasicView;
    
    //[SWF(backgroundColor=0xFFFFFF,frameRate="50", width=465, height=465)]
    public class tyoko extends Sprite
    {
        private var count:uint=0;
        private var bv:BasicView;
        private var tyokolate:Vector.<Cyoko>=new Vector.<Cyoko>;
        private var mat_list:MaterialsList;
        public function tyoko()
        {
            stage.scaleMode=StageScaleMode.NO_SCALE;
            stage.align=StageAlign.TOP_LEFT;
            bv=new BasicView();
            bv.startRendering();
            init_cube();
            addChild(bv);
            addEventListener(Event.ENTER_FRAME,onEnterFrame);
            
        }
        
        public function init_cube():void{
            var mat1:ColorMaterial=new ColorMaterial(0x6F1010,0.6);
            var mat2:WireframeMaterial=new WireframeMaterial(0xEFEFEF,1,1);
            var material:CompositeMaterial=new CompositeMaterial();
            material.addMaterial(mat1);
            material.addMaterial(mat2);
            material.doubleSided=true;
            //mat_list=new MaterialsList({all:material});
            mat_list=new MaterialsList({all:mat1});
        }
        public function move_cyoko():void{
            for(var i:uint=0;i<tyokolate.length;i++){
                tyokolate[i].move();
                if(tyokolate[i].obj.z < -2000){
                    bv.scene.removeChild(tyokolate[i].obj);
                    tyokolate.splice(i--,1);
                }
            }
        }
        
        public function onEnterFrame(e:Event):void{
            count++;
            if(count%10==0){
                var t:Cyoko=new Cyoko(mat_list);
                tyokolate.push(t);
                bv.scene.addChild(t.obj);
            }
            move_cyoko();
        }
    }
}

import flash.display.Sprite;

import org.papervision3d.materials.ColorMaterial;
import org.papervision3d.materials.WireframeMaterial;
import org.papervision3d.materials.special.CompositeMaterial;
import org.papervision3d.materials.utils.MaterialsList;
import org.papervision3d.objects.DisplayObject3D;
import org.papervision3d.objects.primitives.Cube;

class Cyoko extends Sprite{
    public var obj:DisplayObject3D;
    public function Cyoko(mat:MaterialsList){
        
        obj=new Cube(mat,30,70,5,1,1,1);
        obj.z = 0;
        obj.x=300*Math.random()-150;
        obj.y=300*Math.random()-150;
    }
    
    public function move():void{
        this.obj.z-=10;
    }
}