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

WonderflSWFUrl Test

WonderflSWFUrl is a utility class that constructs
swf path from code page url

this example gets swf path from the url
http://wonderfl.net/code/ecefc2d92cc7b9ba0caab3e13ef5dc05b9bf02d7
dynamically loads and adds to the display at runtime
Get Adobe Flash player
by 9re 29 Oct 2009
/**
 * Copyright 9re ( http://wonderfl.net/user/9re )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/zYt0
 */

package {
    import flash.display.Loader;
    import flash.display.Sprite;
    import flash.net.URLRequest;
    import net.wonderfl.utils.WonderflSWFUrl;
    // WonderflSWFUrl is a utility class that constructs
    // swf path from code page url
    // 
    // this example gets swf path from the url
    // http://wonderfl.net/code/ecefc2d92cc7b9ba0caab3e13ef5dc05b9bf02d7
    // dynamically loads and adds to the display at runtime
    public class FlashTest extends Sprite {
        private const CODE_PAGE:String = "http://wonderfl.net/code/ecefc2d92cc7b9ba0caab3e13ef5dc05b9bf02d7";
        public function FlashTest() {
            var ldr:Loader = new Loader;
            // the usage is very simple
            var path:String = WonderflSWFUrl.getURLFromPageURL(CODE_PAGE);
            ldr.load(new URLRequest(path));
            addChild(ldr);
        }
    }
}