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

スクラム道のうちわ

画像:
http://twitpic.com/3znov3

スクラム道バースト
http://kokucheese.com/event/index/7887/
応援作品です。
/**
 * Copyright Akiyah ( http://wonderfl.net/user/Akiyah )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/jxk7
 */

package{
    import flash.display.*;
    import flash.events.*;
    import flash.net.*;
    import flash.system.*;
    import flash.events.MouseEvent;
    import flash.filters.BlurFilter;
    import flash.system.Security;
    import org.papervision3d.core.data.UserData;
    import org.papervision3d.core.effects.view.ReflectionView;
    import org.papervision3d.core.geom.TriangleMesh3D;
    import org.papervision3d.core.proto.MaterialObject3D;
    import org.papervision3d.events.InteractiveScene3DEvent;
    import org.papervision3d.events.FileLoadEvent;
    import org.papervision3d.materials.*;
    import org.papervision3d.materials.special.CompositeMaterial;
    import org.papervision3d.materials.utils.MaterialsList;
    import org.papervision3d.objects.DisplayObject3D;
    import org.papervision3d.objects.primitives.Cube;
    import org.papervision3d.objects.primitives.Plane;
    import org.papervision3d.cameras.CameraType;
    import org.papervision3d.view.BasicView;

    [SWF(backgroundColor="0x303030")]
    public class Sample extends ReflectionView {
        private var loader1:Loader;
        private var loader2:Loader;
        
        Security.loadPolicyFile("http://assets.wonderfl.net/crossdomain.xml");
        public var path:String = "http://assets.wonderfl.net/images/related_images";
        public var filename1:String = path+"/e/e9/e9fb/e9fb60f22bc3299e95e5e72b2005f1409fb525ce";
        public var filename2:String = path+"/1/15/15e8/15e8d06a547081a5be4c5c371bbb3770f3820b1f";
        public var filename3:String = path+"/5/51/51ff/51fff3437d7c6ff7888ffb6cc04c3671c776d2c0";

        public function Sample() {
            viewportReflection.filters = [new BlurFilter()];

            loader1 = new Loader();
            loader1.contentLoaderInfo.addEventListener(Event.COMPLETE, compHandler1);
            loader1.load(new URLRequest(filename1), new LoaderContext(true));        
            
            loader2 = new Loader();
            loader2.contentLoaderInfo.addEventListener(Event.COMPLETE, compHandler2);
            loader2.load(new URLRequest(filename3), new LoaderContext(true));        
            
            addEventListener(Event.ENTER_FRAME, update);
        }

        private function compHandler1(e:Event):void {
            var bmpData:BitmapData = Bitmap(loader1.content).bitmapData;
            var material:BitmapMaterial = new BitmapMaterial(bmpData);
            var plane1:Plane = new Plane(material, 352, 471, 16, 16);
            setupPlane(plane1);
        }

        private function compHandler2(e:Event):void {
            var bmpData:BitmapData = Bitmap(loader2.content).bitmapData;
            var material:BitmapMaterial = new BitmapMaterial(bmpData);
            var plane2:Plane = new Plane(material, 352, 471, 16, 16);
            plane2.rotationY = 180;
            setupPlane(plane2);
        }

        private function setupPlane(plane:Plane):void {
            plane.y = 150;
            plane.rotationZ = 60;
            scene.addChild(plane);
        }

        public function update(e:Event):void {
            var camera_length:Number = 800;
            var c:Number = (mouseX / stage.width - 1) * (Math.PI);
            var d:Number = (mouseY / stage.height + 0.5) * (Math.PI / 2 / 2);
            camera.x = Math.sin(c) * Math.cos(d) * camera_length;
            camera.z = Math.cos(c) * Math.cos(d) * camera_length;
            camera.y = Math.sin(d) * camera_length;
            
            singleRender();
        }
    }
}