• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

[JS CS3/4] Stop closing process problem (onEvent)

People's Champ ,
Oct 19, 2009 Oct 19, 2009

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

TOPICS
Scripting

Views

669

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Oct 20, 2009 Oct 20, 2009

Hi Loic,

Is beforeClose cancelable?

Try:

alert(myEvent.cancelable);

If false, you can't prevent default behavior.

@+

Marc

Votes

Translate

Translate
Guide ,
Oct 20, 2009 Oct 20, 2009

Copy link to clipboard

Copied

Hi Loic,

Is beforeClose cancelable?

Try:

alert(myEvent.cancelable);

If false, you can't prevent default behavior.

@+

Marc

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Oct 20, 2009 Oct 20, 2009

Copy link to clipboard

Copied

Good shot Marc,

Thanks a lot for your input. I have to find another way then 🙂

A+ Loic

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Oct 20, 2009 Oct 20, 2009

Copy link to clipboard

Copied

In another thread, Kasyan Servetsky suggested to re-open the document:

http://forums.adobe.com/message/1107497#1107497

@+

Marc

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Oct 20, 2009 Oct 20, 2009

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines