These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Blocking an event

amin.nas
Registered: Oct 3 2007
Posts: 37

How can I block an event until the pre-print event?

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You can block an event script, but the events themselves are controled through Acrobat, which you can't do anything about.

Define a variable that you'll use for blocking and then test it before running any event script.

Define the variable by attaching it to the top of the form hierarchy.

if(typeof(xfa.form.form1.bBlockEvent) != "undefined" && !xfa.form.form1.bBlockEvent)
{
.... Do event Script ...
}

Then in the Pre Print event use this script:

xfa.form.form1.bBlockEvent = false;

Don't set this variable up in a script Object. The script objects are re-run every once in a while, so the blocking variable would be reset at arbitrary intervals.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script