TechHui

Hawaiʻi's Technology Community

Flash external FLV file: how to stop audio upon button click in main file?

I've spent a couple of days researching this problem-- which seems common-- but can't seem to get a straight answer.

Situation:
I'm calling external SWF files to play in my main timeline using a loader function. The buttons include the removeChild (loader); before calling a new SWF. All works fine,

Problem:
When one navigates away from an external SWF that contains a FLV (video) file, the video's audio continues to play even though the file was removed. I'm not using video components---the video in the external SWF is called and controlled with Actionscript. If I was working within a single timeline, this would be a snap to code out. However, I'm calling the entire SWF externally (and several of the files have FLV assets).

Clearly, there's a bit of code needed for the button on the main file to stop the Netstream connection in the external file. However, I can't seem to nail it down since it should be set up as a variable (for use on any SWF within the site--like RemoveChild (loader);) rather than targeting the specific file's instance name in the external SWF.

I'd be happy to share the code and URL if anyone has insight on resolving things.
Currently, repeated button clicks seem to effectively scrub the audio--not a good option.

Views: 235

Replies to This Discussion

Have you tried using SoundMixer.stopAll(); to kill the audio
You can also try stopping the flv before removing the child

var swf:MovieClip=loader.content as MovieClip;
swf.myFlvplayer.stop();
I'll give the suggestions a whirl.

I think var swf:MovieClip=loader.content as MovieClip;
swf.myFlvplayer.stop(); might be the ticket. It follows the logic of how things are set up.

Happy New Year, Gus

RSS

Sponsors

web design, web development, localization

© 2024   Created by Daniel Leuck.   Powered by

Badges  |  Report an Issue  |  Terms of Service