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

copy of useless website

It is not my idea.
The original is in the uselesswebsite.
http://www.theuselessweb.com/
http://www.koalastothemax.com/
Get Adobe Flash player
by pullinear 29 Nov 2012
  • Related works: 1
  • Talk

    makc3d at 28 Nov 2012 19:30
    Hey, I remember that zoom blur code )
    pullinear at 29 Nov 2012 02:38
    Yes, sorry.. i use codewort's image load code and image. I fix it..
    makc3d at 30 Nov 2012 22:15
    Why fix it? That's a nice image.
    pullinear at 01 Dec 2012 15:05
    ?
    pullinear at 01 Dec 2012 15:05
    ?
    makc3d at 02 Dec 2012 19:48
    I thought you were going to remove the image so I said you should not

    Tags

    Embed
/**
 * Copyright pullinear ( http://wonderfl.net/user/pullinear )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/4kAe
 */

package {
    import flash.net.URLRequest;
    import flash.display.Loader;
    import flash.events.Event;
    import flash.display.Shape;
    import flash.geom.Point;
    import flash.display.Sprite;
    import flash.system.LoaderContext
    import flash.display.Bitmap
    import flash.display.BitmapData
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..
            var startPoints:Array = new Array();
            var endPoints:Array = new Array()
            var backGround:Shape = new Shape();
            var speedControl:int = 0;
            var index:int = -1;
            var blackAdd:Shape = new Shape();
            blackAdd.graphics.beginFill(0x0);
            blackAdd.graphics.drawRect(0,0,512,512);
            blackAdd.graphics.endFill();
            addChild(blackAdd);
            
            //this is codewort's code and image~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            //the original code is in here : http://wonderfl.net/c/r49o
            var loader:Loader = new Loader();
            var url:URLRequest = new URLRequest("http://assets.wonderfl.net/images/related_images/d/d9/d9b9/d9b9e27367920f3ef42cc14e1155ec0f18908b3b"); 
            loader.load(url, new LoaderContext(true)); 

            loader.contentLoaderInfo.addEventListener("complete", load_complete)
            var src:BitmapData = new BitmapData(512, 512, false);
            
             
            function load_complete(e:Event):void {
                src.draw(e.target.content);  
            // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                
                startPoints[0] = new Point(0,0);
                endPoints[0] = new Point(512,512);
                drawDividedRect(backGround, startPoints, endPoints,src);
                addChild(backGround);
               // addChild(new Bitmap(src));
                addEventListener("enterFrame", ente);         
            }
            

            function ente(e:Event):void {
                speedControl++;
                if(speedControl % 1 == 0) {
                    speedControl = 0;
                    index = indexOfinIt(startPoints, endPoints, stage.mouseX, stage.mouseY);
                    if(index != -1) {
                        divide(startPoints, endPoints, index);
                        backGround.graphics.clear();
                        drawDividedRect(backGround, startPoints, endPoints,src);
                    }
                }

            }

            
            
            
            
        }
        // find index of rects which include the point
        public function indexOfinIt(starts:Array, ends:Array, nowX:int , nowY:int):int
        {
            for(var i:int = 0; i < starts.length; i++) {
                if(inIt(starts[i], ends[i], nowX, nowY) ) {
                    return i;
                }

            }
            return -1;

        }
        // test that point is in the rect
        public function inIt(start:Point, end:Point, nowX:int, nowY:int):Boolean
        {
            if(nowX > start.x && nowX < end.x && nowY > start.y && nowY < end.y) {
                return true;
            }

            return false;
        }
        // drawRect
        public function drawRect(s:Shape, start:Point, end:Point, col:uint = 0x0):void
        {
            s.graphics.beginFill(col);
            s.graphics.drawCircle( (start.x+ end.x )/2, (start.y + end.y) /2 , (end.x - start.x) /2);
            
        }
        // drawRects
        public function drawDividedRect(s:Shape, starts:Array, ends:Array, src:BitmapData):void
        {
            for(var i:int = 0; i < starts.length; i++) {
                drawRect(s, starts[i], ends[i], src.getPixel( (starts[i].x+ends[i].x)/2, (starts[i].y + ends[i].y )/2  ) );
            }

        }

        //divide rect into 4 rects.
        // divided rects saved last index of the Array
        public function divide(start:Array, end:Array, Index:int):void
        {
            var tSP:Point = start[Index];
            var tEP:Point =end[Index];
            if(  tEP.x - tSP.x > 2) {
                var mX:int = (tEP.x + tSP.x) / 2;
                var mY:int = (tEP.y + tSP.y) / 2;
                start.push(new Point(tSP.x, tSP.y));
                start.push(new Point(mX,tSP.y));
                start.push(new Point(tSP.x , mY));
                start.push(new Point(mX,mY));
                end.push(new Point(mX,mY));
                end.push(new Point(tEP.x, mY));
                end.push(new Point(mX,tEP.y));
                end.push(new Point(tEP.x, tEP.y));
                start.splice(Index, 1);
                end.splice(Index, 1);
            }



            
        }
 
        
    }

}