views:

656

answers:

2

OK I have built an application which uses the youtube API. It loads a video into the application when the user clicks a button. If the user clicks another button a new video is loaded in it's place. You can see it here: http://www.grantanderson.net/blogFiles/honours/youtube.html

Everything works except the audio from the previous video doesn't stop.

I use

ytplayer.stopVideo();

ytplayer.clearVideo();

I tried adding at the end of this

ytplayer.destroy();

But it hasn't fixed the problem.

A: 

With AS2, you often have memory issues. Unfortunately this is often unavoidable. The good news is that there is a way around that.

ytplayer.swapDepths( 1000 );
delete ytplayer;

createEmptyMovieClip( "whoCares", 1000 );
delete whoCares;

It is a bit... overkill, but this will destroy any display object completely.

Christopher W. Allen-Poole
A: 

The answer still not working