Unload and stop the swf from scene

Hello

I am a newbie in Flash and Actionscript. I need to give links to about 20 files swf via the menu.swf buttons. I am able to give links. But when I come back by clicking the HOME button held in the newly loaded swf audio files are always played in the background.

Yes, there are audio files playing in the back for each slide in the new FSV. Then click the link even menu.swf again once the files are played with the old incomplete file. It's really intense.

I need to unload the scene completely when I return to menu.swf by clicking the HOME button on one of the 20 categories.

I used unloadAndStop but it does not. I hope I'm mistakes of committing to a place but could not provide.

Need help!

FOR THE HOME BUTTON:


var _content:Loader = new Loader();

function loadContent(content:String):void {}

If (_content! = null) {}

_content.unloadAndStop (true);

removeChild (_content);

_content = null;

}

var loader: Loader = new Loader();

Loader.Load (new URLRequest (content)); -> > > > I don't really know what to put in this :-(

_content = addChild (loader) like charger;

}

Home_Button.addEventListener (MouseEvent.CLICK, home);

function home(event:MouseEvent) {}

_content.unloadAndStop (true);

var homeSWF:URLRequest = new URLRequest ("demo.swf");

_content. Load (homeSWF);

addChild (_content);

}

MENU.swf BUTTON

var loader: Loader = new Loader();

Category1_Button.addEventListener (MouseEvent.CLICK, category 1);

function category1(event:MouseEvent):void {}

var Category1SWF:URLRequest = new URLRequest("Category1.swf");

Loader.Load (Category1SWF);

addChild (loader);

}

I think that there is a question of terminology.

your main swf is the SWF that is embedded in your html page.  It is the first swf to display, and it can not be unloaded using actionscript.

It must contain the loader, the only case of Loader, you need.

This main swf may or may not be main.swf.

in your main swf file, you must use:

/////////////////////////////////

var loader: Loader = new Loader();

addChild (loader);

function loadF(fileS:String):void {}

{if (Loader.Content)}

loader.unloadAndStop ();

}

Loader.Load (new URLRequest (fileS));

addChild (loader);

}

function unloadF (): void {}

{if (Loader.Content)}

loader.unloadAndStop ();

}

}

/////////////////////////////////////////

do not change anything between the lines.

----------------------------------------------------

your main SWF, if you want to load "catgoryxyz.swf", use:

loadF ("categoryxyz.swf");  This argument in this line, you can and will change

you main swf, if you want to unload all that is been loaded (and seem to go back to your file main swf), use:

unloadF();

---------------------------------------------------

Since the script a swf loaded (as categoryxyz.swf) principal, if you want to load "categoryabc.swf", use:

MovieClip (this.parent.parent) .loadF ("categoryabc.swf");  the argument in this line, you can and will change

If you want a swf to unload himself (and seem to go back to your main swf file), use:

MovieClip (this.parent.parent) .unloadF ();

-----------------------------------------------------------------

Tags: Adobe Animate

Similar Questions

Maybe you are looking for

  • How can I block messages unwanted popup Flash?

    I'm browsing without Flash installed. When I go to certain sites or pages in some sites, a small pop up icon in the upper left corner of the window. The icon invites me to install flash. The icon can be closed, but after many repetitions becomes bori

  • Can I install SSD hard drive in the version of Windows XP Media Center 2002.

    Original title: ssd hard drives I have a Sony desktop running Windows XP Media Center version 2002. I am thinging about buying an SSD hard drive. I was wondering if it will work

  • T420 PCI Simple Communications Controller

    Due to software problems (won't it 64 compatibal until end of July) I had to convert to Win7 32 bit. Now I have a device without driver. PCI Simple Communications controller. Its location is bus PCI 0, 22, function 0 device.

  • E7440: Audio Jack does not detect all connect more

    Hi all I am reported a strange problem. I use E7440 with Windows 7 64-bit with Realtek HD Audio driver (as shown below). My computer also has 'AUDIO DELL' management utility. Previously, external headphones and portable speakers were working well and

  • My PS3 will not identify other readers, apart from my C drive

    Hello I use Windows 7 64-bit. I set up networking in my house, all computers can display the content, I've shared, but the PS3 is only picking up the stuff that is in my "library" on my C:\ Drive. I added my H:\ files to the 'Library', but the ps3 st