actionscript 3 - Flash AS3 - Importing external SWF causes Error #2007 -


i have weird issue importing external swf in actionscript 3.0. want import swf made easypano tourweaver 7.96 when i'm doing i'm getting error #2007: parameter child must non-null. here code:

var vrarea:movieclip = new movieclip();  vrarea.x = 0; vrarea.y = 96;  addchild(vrarea);  var my_loader:loader = new loader(); var urlrequest : urlrequest = new urlrequest("vr/vr_candela.swf");  my_loader.contentloaderinfo.addeventlistener(event.complete, loadercomplete); my_loader.load(urlrequest);  function loadercomplete(event:event):void {     vrarea.addchild(my_loader); } 

the complete error shown below:

typeerror: error #2007: il valore del parametro type deve essere diverso da null. @ flash.events::eventdispatcher/addeventlistener() @ `[::-v/5?() @ ->::4j/step4_2_startui() @ ->::4j/`z() @ [a::&=/1?() @ [a::%c/dispatch() @ !a::%d/load() @ ->::4j/step3_1_loadconfig() @ ->::4j/step3() @ ->::4j/step2_createcontext3d() @ ->::4j/%$() @ flash.events::eventdispatcher/dispatcheventfunction() @ flash.events::eventdispatcher/dispatchevent() @  $::twloadingwindow/+&() @ flash.events::eventdispatcher/dispatcheventfunction() @ flash.events::eventdispatcher/dispatchevent() @ 0m::1x/;$() @ 0m::1x/3@() @ function/http://adobe.com/as3/2006/builtin::apply() @ 0m::>5/&s() 

additional info: i'm getting loading screen of external swf.

you should use event.target in listener add loader object. more, since you've assigned listener loaderinfo property, need object's content object loaded swf.

function loadercomplete(event:event):void {     var li:loaderinfo=event.target loaderinfo;     if (!li) return; // failed typecast     vrarea.addchild(li.content); // add content } 

Comments