This has been an issue for me and thousands of other Flash developers for, well, quite a few years – the problem happens when you want to stop an FLV from continuing to play by either stopping it and removing it from the stage like this:
flv.source = null;
I used to have to check the stream for its state and do things based on that but now this just properly removes it. Well I hope this code might just be the final solution – it seems to also work well across the browsers I tested it with (Safari 4.0.5, Firefox 3.6.2, IE 8.0.6001).
The code is simple – make a reference to your FLVPlayback component, get the video player index (usually 0 if you’re not using multiple video player indexes) and then close it.
First remember to import the VideoPlayer class and any other classes you need.
var my_vp:VideoPlayer = my_flv.getVideoPlayer(0);
And that’s it! No more audio continuing playing after you allegedly unloaded a video or removed it.
Hope that helps someone.