FORUMS: list search recent posts

removing external SWF...

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Sam Aswat
removing external SWF...
on Jul 4, 2011 at 10:45:19 am

Hi there!

I am loading an external swf file, which works fine. My return button is on my main timeline. So when I press return, I want to remove the external swf file.

I am having a hard time doing so, since on my main timeline, the removeChild(myExternalSWF) wont work. On the timeline where I load & addChild(myExternalSWF), the return button can't be accessed. How do I go about removing the ext swf???

Thank you for your help!!


Return to posts index

demetri tashie
Re: removing external SWF...
on Jul 7, 2011 at 5:02:52 pm


it is always good to add some code so we can see what we are dealing with. Otherwise, we are just taking stabs at your request for help.

here is a good scenario for loading and unloading an external swf via a 'load_btn' and an 'unload_btn' on the main timeline stage, which will load and unload an external swf 'externalSWF.swf'
the traces are there just to show/prove what is on the stage( object MainTimeline as referred to by 'this')

note that the 'unloadAndStop()' method is only available from CS4 on
var myLoader:Loader = new Loader();
var url:URLRequest = new URLRequest('externalSWF.swf');

load_btn.addEventListener(MouseEvent.CLICK, loadSWF);
unload_btn.addEventListener(MouseEvent.CLICK, unloadSWF);


function loadSWF(e:MouseEvent):void {

function unloadSWF(e:MouseEvent):void {

hope that helps

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved