3d bear - catch me
// 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);
}
}
}