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

3d bear - catch me

Get Adobe Flash player
by elecgon 28 Jan 2010
// forked from elecgon's flash on 2010-1-28
package {
	import flash.text.TextField;
	import flash.system.Security;
	import flash.utils.getDefinitionByName;
	import flash.system.LoaderContext;
	import flash.net.URLRequest;
	import flash.display.Loader;
	import flash.geom.Rectangle;
	import flash.events.Event;
    import flash.display.Sprite;
    import flash.system.ApplicationDomain;
    
	[SWF(backgroundColor="0xffffff", framerate=20, width=300, height=300)]
    public class FlashTest extends Sprite {
        public function FlashTest():void
        {
            // write as3 code here..
            this.addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
        }
        
        private function onAddedToStage(e:Event):void
        {
			e.target.removeEventListener(e.type, arguments.callee);

			Security.allowDomain("*");
			
			var loader:Loader = new Loader();
			loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLibraryLoaded);
			loader.load(new URLRequest("http://elecgon.appspot.com/LovelyBear.swf"), new LoaderContext(false, ApplicationDomain.currentDomain));
			
			this.addChild(loader);
			this.graphics.drawRect(0, 0, 100, 100);       	
        }
        
        private function onLibraryLoaded(e:Event):void
        {
			e.target.removeEventListener(e.type, arguments.callee);
			
			//this.addChild(e.target);
			
			var tf:TextField = new TextField();
			tf.x = 120;
			tf.y = 340;
			tf.width = 300;
			tf.text = "coding by Yongshik Cho (elecgon@gmail.com)";
			this.addChild(tf);
			
        }
        
    }
}