Let's say you have a button that retrieves a piece of sensitive info from the server that needs to be shown to the customer for a short period of time. After that this message needs to be hidden.
Here is the piece of code that goes to Button 'Client After' event and does the job.
// this message includes the SSN retrieved from the server
var message = result["txt"] ;
ctrl.setMessage(message);
// clear the message after 5 seconds
setTimeout(function(ctrl) {
ctrl.setMessage("");
}
, 5000, ctrl);