Unloading swf using the unloadAndStop() method, but video sounds remain audible

前端 未结 4 1860
眼角桃花
眼角桃花 2021-01-24 05:00

I have tried many approaches to unloading my swf, but to no avail, the video sounds within my laoded swf keep playing even once the swf has been loaded.

I have created a

4条回答
  •  Happy的楠姐
    2021-01-24 05:41

    The appropriate way to handle this is to program a destroy function into whatever loaded content you have, and then call it before you unload that content. In the destroy function the loaded swf should be responsible for its own business in regards to...

    • Stopping playing sounds.
    • Closing any open streams (like streaming video).
    • calling stop on its timelines
    • etc...

    SoundMixer.stopAll() is in no way an appropriate solution. Rather, it can be if you are the one setting the parameters of what is "acceptable" as a jarring user experience, but if you are writing a 3rd party swf that is to be loaded into someone else's application you'll most certainly be responsible for cleaning up your own sound mess, and SoundMixer will kill not just your sounds, but the sounds from the loader, and that is one sure fire way to anger your hosts.

提交回复
热议问题