Working With Eventlisteners - Adobe 65009333 - InCopy CS4 - PC Manual

Scripting guide: javascript
Hide thumbs Also See for 65009333 - InCopy CS4 - PC:
Table of Contents

Advertisement

Events
Property
Bubbles
Cancelable
Captures
CurrentTarget
DefaultPrevented
EventPhase
EventType
PropagationStopped
Target
TimeStamp

Working with eventListeners

When you create an
JavaScript function or file reference), and whether the
phase of the event. The following script fragment shows how to add an
event (for the complete script, see AddEventListener).
#targetengine "session"
main();
function main(){
var myEventListener = app.addEventListener("afterNew", myDisplayEventType,
false);
}
function myDisplayEventType(myEvent){
alert("This event is the " + myEvent.eventType + " event.");
}
To remove the
RemoveEventListener tutorial script):
app.removeEventListener("afterNew", myDisplayEventType, false);
When an
that might be monitoring the event (depending on the propagation of the event). For example, the
Description
If true, the
the
event
If true, the default behavior of the
this, use the
If true, the
objects above the target object of the event during the capturing phase of
event propagation. This means an
example, can respond to a document event before an
triggered.
The current scripting object processing the
If true, the default behavior of the
this table) was prevented, thereby cancelling the action.
The current stage of the
The type of the
If true, the
target
method.
The object from which the
beforeImport
The time and date the
eventListener
created by the above script, run the following script (from the
eventListener
responds an event, the event may still be processed by other
eventListener
propagates to scripting objects above the object initiating
event
.
method.
PreventDefault
may be handled by
event
event
, as a string (for example,
event
has stopped propagating beyond the
event
in this table). To stop event propagation, use the
event
event is a document; of a
occurred.
event
, you specify the event type (as a string) the event handler (as a
eventListener
Working with eventListeners 73
on its
event
target
eventListeners
on the application, for
eventListener
. See
event
on the current
event
propagation process.
"beforeNew"
originates. For example, the
event, the application.
beforeNew
can be triggered in the capturing
eventListener
can be canceled. To do
registered to scripting
is
eventListener
in this table.
target
(see
in
target
target
).
(see
current target
stopPropagation
of a
target
for a specific
eventListeners

Advertisement

Table of Contents
loading

This manual is also suitable for:

Incopy cs4

Table of Contents