Hi FK, I need to stop/close a netStream from Javascript, the reason is the video plays in a modal popup window, when popup window is closed the netstream is still open, you can hear Audio, so I need to stop/close netSteam from the close btn action. So starting here with OnClientClick="btn_close_nsStream"

Ive looked into flash.external.ExternalInterface and thought this maybe the way to go. I really need some help! Am I on the right track? Many Thanks.

//AS3

ExternalInterface.addCallback("close_nsStream", null, close_nsStream);

function close_nsStream():Void {
nsStream.close();
}


//JS

function getFlashMovie(movieName) {

var isIE = navigator.appName.indexOf("Microsoft") != -1; return (isIE) ? window[movieName] : document[movieName];
}

function btn_close_nsStream() {
getFlashMovie("HD-1").close_nsStream();
}