Skip to main content
Inspiring
July 9, 2015
Question

IN CC Windoe not closed on execution of the statement

  • July 9, 2015
  • 1 reply
  • 280 views

If there exist an object of Window, and when close() method is called then window not closes if it is followed by another set of statement. For eg Consider  a snippet

   var win = new Window('dialog', 'Save As');

  saveBtn.onClick = function() {

                    var fileName = win.prefixEt.text;

                    var filePath = win.dirEt.text;

                    win.close() ;

                    save(layerSetArray,fileName,filePath);

            };

There exist two button in this dialog. On click of save button, window not closes till the time it will not execute the save() method as well. But on CS^ version first it closes the window and then execute the save() method. Is this the bug in CC. If yes, then how to resolve this or any work around for the same.

This topic has been closed for replies.

1 reply

Silly-V
Legend
July 9, 2015

what if you close the window after doing the save?

Inspiring
July 10, 2015

Window closes. But the actual scenario is first I open window that will ask to save an Illustrator file in specific format. When I am going to save that file I Would like to check is that file already exist in that location if yes then I would like to show another window for "Replace" asking for to replace the file. At this moment I want that save dialog should be close. Right now both are opened.