Ok I have done a lot of reading and although it is not explicitly stated it seems createServerHandler is only designed for global functions and nothing else is provided in the UIAPP. That means what I have asked for cannot be done.
The solution would have to look like
function myWindow(message) {
this.SS = SpreadsheetApp.getActiveSpreadsheet();
this.App = UiApp.createApplication();
this.App.setTitle(message);
this.Panel = this.App.createVerticalPanel();
this.App.add(this.Panel);
this.Button = this.App.createButton('OK', this.App.createServerHandler('handler'));
}
myWindow.prototype = {
constructor: myWindow,
show: function() {
this.Panel.add(this.Button);
this.SS.show(this.App);
}
};
function handler(e) {
Browser.msgBox('Click');
};
function Run() {
var theWindow = new myWindow('Hello World');
theWindow.show();
};
which is not flash but workable.