Procedure "window.close()" do not working corectly?
Hi Everyone!
I noticed that the procedure "window.close()" in my scripts is not working properly. This procedure works for the first time only.
// TWO WINDOWS TESTING
var win_1= new Window("palette", "Window 1",undefined);
var win_2= new Window("palette", "Window 2", undefined);
buildUI_window1();
buildUI_window2();
win_1.center();
win_1.show();
win_2.center();
function buildUI_window1() {
win_1.btn = win_1.add("button", undefined, "SHOW WINDOW 2");
win_1.btn.onClick = function() {
win_2.btn.text = "CLOSE";
win_2.show();
}
}
function buildUI_window2() {
win_2.btn = win_2.add("button", undefined, "CLOSE");
win_2.btn.onClick = function() {
win_2.close(); // This window can be close at firt time only!
}
}
This script showing two windows.
At first time:
I open my second window click the "SHOW WINDOW 2" button .
It opened.
In the second window click the "CLOSE" button.
It closed.
At second time:
I open my second window again.
It opened.
At this time, to close the "Window 2" will not work.
Caution! This second window can be removed only by closing the After Effects.
Thanks,
Sergio
