Hi people, an AS newbie here with a simple question i hope is easy to answer!
I have two files. parent.fla contains a button that loads the external “child.swf” and child.fla contains a button that removes this very file – which never works, giving me the good old Error #1034: Type Coercion failed: cannot convert global@1cf60101 to flash.display.DisplayObject.at MethodInfo-4()
parent.fla:
var t:URLRequest=new URLRequest("child.swf");
var loader:Loader=new Loader();
AC_btn.addEventListener(
MouseEvent.MOUSE_UP,
function (evt:MouseEvent):void {
loader.load(t);
stage.addChild(loader);
}
);
child.fla:
RC_btn.addEventListener(
MouseEvent.MOUSE_UP,
function(evt:MouseEvent):void {
[COLOR=Gray] //the following line is the crunch:[/COLOR]
root.removeChild(this);
}
);
I’ve tried parent, this.parent and about any other word i could think of, but methinks there is something wrong with the loader. Any suggestions would be hugely appreciated!