Copy link to clipboard
Copied
Hi,
I try to stop a closing operation through an event listener.
I used that :
#targetengine session
docEvt();
function docEvt()
{
var myEventListener = app.eventListeners.add("beforeClose",myAddDocGlobalEvt, false);
}
function myAddDocGlobalEvt(myEvent)
{
myEvent.stopPropagation();
myEvent.preventDefault();
alert('stop');
}
However, when I close the document...it's closed 😞
I get the 'stop' alert but the document window is no longer visible.
I would like to really stop the closing process. What do I do wrong ?
TIA Loic
Hi Loic,
Is beforeClose cancelable?
Try:
alert(myEvent.cancelable);
If false, you can't prevent default behavior.
@+
Marc
Copy link to clipboard
Copied
Hi Loic,
Is beforeClose cancelable?
Try:
alert(myEvent.cancelable);
If false, you can't prevent default behavior.
@+
Marc
Copy link to clipboard
Copied
Good shot Marc,
Thanks a lot for your input. I have to find another way then 🙂
A+ Loic
Copy link to clipboard
Copied
In another thread, Kasyan Servetsky suggested to re-open the document:
http://forums.adobe.com/message/1107497#1107497
@+
Marc
Copy link to clipboard
Copied
Hi Marc,
All my apologies for the community. Weird I ain't thought to have a look on archives :-S
Thanks for all your care.
Loic