YouTube api audio doesn't stop playing
OK I have created an application that uses the youtube API. It loads the video into the app when the user clicks the button. If the user clicks on another button, a new video is loaded on him. You can see it here: http://www.grantanderson.net/blogFiles/honours/youtube.html
Everything works, except that the audio from the previous video doesn't stop.
I use
ytplayer.stopVideo();
ytplayer.clearVideo();
I tried to add at the end of this
ytplayer.destroy();
But the problem persists.
0
Grant Anderson
a source
to share
1 answer
In AS2, you often have memory problems. Unfortunately, this is often inevitable. The good news is that there is a way around this.
ytplayer.swapDepths( 1000 );
delete ytplayer;
createEmptyMovieClip( "whoCares", 1000 );
delete whoCares;
A bit ... overkill, but this will completely destroy any display object.
0
a source to share