Discussion:
Importing exteranl SWF's onto stage
KieranD
2011-04-26 16:02:07 UTC
Permalink
Sorted this out. common error aparntly.

public function ExternalSWF()
{

this.addEventListener(Event.ADDED_TO_STAGE, onStage);
}

private function onStage(e:Event):void
{
this.removeEventListener(Event.ADDED_TO_STAGE, onStage);

}

Hope this helps others.

Kieran

--
View this message in context: http://papervision3d.758870.n4.nabble.com/Importing-exteranl-SWF-s-onto-stage-tp3450000p3475829.html
Sent from the Papervision3D mailing list archive at Nabble.com.
KieranD
2011-04-26 16:05:45 UTC
Permalink
Now All I have to do is unload the swf. Anyone have any ideas?
Thanks

Kieran

--
View this message in context: http://papervision3d.758870.n4.nabble.com/Importing-exteranl-SWF-s-onto-stage-tp3450000p3475836.html
Sent from the Papervision3D mailing list archive at Nabble.com.
KieranD
2011-04-27 19:07:06 UTC
Permalink
Got this sorted this too!

Put this in your external file:

private function exit(event:MouseEvent):void
{
dispatchEvent(new Event("UnloadMe", true));

}


And this in your Main:

private function clickme (e:InteractiveScene3DEvent):void
{
var loader:Loader = new Loader();
var urlRequest:URLRequest;

urlRequest = new URLRequest("external.swf");
loader.load (urlRequest);
addChild(loader);

//shoe unloader part 2 0f 2 (exit external swf)
loader.addEventListener("UnloadMe", unloadFunction)

}

private function unloadFunction(event:Event):void
{
Loader(event.currentTarget).unload();
}

Hope this helps others. As a guy that's just getting the hand of as3, I know
what its like looking for help!

Kieran

--
View this message in context: http://papervision3d.758870.n4.nabble.com/Importing-exteranl-SWF-s-onto-stage-tp3450000p3479189.html
Sent from the Papervision3D mailing list archive at Nabble.com.

Loading...