Simple problem with Netstream

Hi everyone ,

If publishing of a stream has been stopped then “NetStream.Unpublish.Success” will be broadcasted to all the clients .

My question is how to stop publishing of the stream when we click on a button.

Thanks.