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

flash on 2012-9-19

Get Adobe Flash player
by makc3d 19 Sep 2012

    Talk

    makc3d at 21 Jul 2013 14:24
    still works in 11.8 :)
    makc3d at 09 May 2014 18:07
    still works in 12.0 :)
    makc3d at 07 Aug 2014 19:23
    still works in 14.0.0.145 :)
    makc3d at 30 Apr 2015 19:55
    still works in 17.0.0.169 :)
    makc3d at 26 Sep 2015 06:25
    still works in 19.0.0.185

    Tags

    Embed
package {
    import flash.display.*;
    import flash.events.*;
    import flash.geom.*;
    import flash.net.*;
    import flash.system.*;
    import com.actionscriptbible.*;
    public class FlashTest extends Example {
        
        public var bitmap:Bitmap;
        
        public function FlashTest() {
            // this line matters
            Security.allowDomain("*");
            // okay, let's load some random picture
            var request:URLRequest = new URLRequest ("http://www.google.me/images/srpr/logo3w.png");
            // we are going to load in bitmap loader
            var loader:Loader = new Loader;
            // do smth unexpected: http://www.flasher.ru/forum/blog.php?b=588
            loader.addEventListener (Event.ADDED, onBitmapAdded);
            // wait for complete
            loader.contentLoaderInfo.addEventListener (Event.COMPLETE, onImageLoaded);
            // load it
            loader.load (request);
            
        }
        
        public function onBitmapAdded (e:Event):void {
            if (bitmap == null) bitmap = e.target as Bitmap;
        }
        
        public function onImageLoaded (e:Event):void {
            if (bitmap == null) return;
            
            var bd:BitmapData = bitmap.bitmapData.clone();
                
            var ct:ColorTransform = new ColorTransform (0, 1, 0);
            bd.colorTransform (bd.rect, ct);
            
            with (addChild (new Bitmap (bd))) { x = 100; y = 200; } 
        }
    }
}