After effects scripting
Hello
I have this simple code to create ui docable panel for after effects and i want to click the button and colse panel but it isn't working, any help? :
function createDockableUI(thisObj) {
var dialog = thisObj instanceof Panel ? thisObj : new Window("window", undefined, undefined, { resizable: true });
dialog.onResizing = dialog.onResize = function() { this.layout.resize(); };
return dialog;
}
function showWindow(myWindow) {
if (myWindow instanceof Window) { myWindow.center(); myWindow.show(); }
if (myWindow instanceof Panel) { myWindow.layout.layout(true); myWindow.layout.resize(); }
}
var win = createDockableUI(this);
var button1 = win.add("button", undefined, "TestMe");
button1.onClick = function() { win.close(); };
showWindow(win);
