Adobe Forums

Add Me
Adobe Forums » Adobe Influences » Site Design » AS3 - stopping sound in externally loaded SWFs

Tags:



Reply
LinkBack Thread Tools Display Modes
AS3 - stopping sound in externally loaded SWFs
  #1 (permalink)  
Old 09-20-2008, 06:54 PM
patrickrs
Guest
 
Posts: n/a
Default AS3 - stopping sound in externally loaded SWFs

Hi folks...I've spent hours trying to solve this; to no avail.

I've built a Flash movie that demos a new website. The Flash movie loads 14
external SWF files, each of which contains a single narration sound clip.

I can get the external SWFs to load just fine, but when I load the next clip,
the sound from the first clip keeps playing. I can use SoundMixer.stopAll();,
but that has the unfortunate effect of also stopping my soundtrack, which plays
in the main timeline of the container file.

I've heard there is a way to stop sounds contained in external SWFs, something
about NetStream, but haven't been able to get it to work.

Complicating the matter: I can't edit the set of 14 external SWF files.
Whatever solution I use must be implemented from the main container Flash file.

Can anyone help me with this? Here's a sample of the code I use to load in
each SWF:

one_mc.addEventListener(MouseEvent.CLICK, go1);

function go1(myevent:MouseEvent):void {
myLoader.load(myRequest);
myLoader.contentLoaderInfo.addEventListener(Event. OPEN,showPreloader);

myLoader.contentLoaderInfo.addEventListener(Progre ssEvent.PROGRESS,showProgress)
;
myLoader.contentLoaderInfo.addEventListener(Event. COMPLETE,showContent);
**

And here is the preloader code I use:

function showPreloader(event:Event):void {
addChild(myPreloader);
myPreloader.x = stage.stageWidth/2;
myPreloader.y = stage.stageHeight/2;
**

function showProgress(event:ProgressEvent):void {
var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
myPreloader.loading_txt.text = "Loading - " + Math.round(percentLoaded *
100) + "%";
myPreloader.bar_mc.width = 198 * percentLoaded;
**
function showContent(event:Event):void {
removeChild(myPreloader);
addChild(myLoader);
myLoader.x = 20;
myLoader.y = 155;
**

Thanks!!



Reply With Quote


Reply



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Hairstyles | UFO Videos | Bollywood Wallpapers | Poems  | WWE


All times are GMT. The time now is 12:43 AM.
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.