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

forked from: for my icon image

Get Adobe Flash player
by argon 19 Feb 2012
    Embed
/**
 * Copyright argon ( http://wonderfl.net/user/argon )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/uEad
 */

// forked from codeonwort's for my icon image
package {
    
    import flash.display.Bitmap
    import flash.display.Shape
    import flash.display.BitmapData
    import flash.display.Sprite
    
    [SWF(backgroundColor=0x0)]
    public class FlashTest extends Sprite {
        
        private var icon:BitmapData
                        
        public function FlashTest() {
            // write as3 code here..
            icon = new BitmapData(400, 400, true, 0x0)
            addChild(new Bitmap(icon))
            
            draw()
            stage.addEventListener("mouseDown", draw)
        }
        
        private function draw(e:Object=null):void {
            icon.fillRect(icon.rect, 0x0)
            var shape:Shape = new Shape
            var cnt:int = 30*Math.random()+100;
            for(var i:int=0; i<cnt; i++){
                shape.graphics.clear()
                shape.graphics.beginFill(Math.random() * 0xffffff, Math.random() * .5)
                shape.graphics.drawCircle(Math.random() * 400, Math.random() * 400, 5 + Math.random() * 60)
                icon.draw(shape, null, null, "add")
            }
        }
        
    }
    
}