EDOBE XDOM TAKE 6 IR - PRODUCTSHEET Especificaciones Pagina 83

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 304
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 82
CHAPTER 4: User-Interface Tools Defining behavior with event callbacks and listeners 83
myButton.addEventListener( ’click’, myFunction );
X
A locally defined handler function that takes one argument, the event object. For example:
myButton.addEventListener( ’click’, ’function(e){/*handler code*/}’);
The handler or registered code statement is executed when the specified event occurs in the target. A
script can programmatically simulate an event by creating an event objects with
ScriptUI.events.events.createEvent(), and passing it to an event targets dispatchEvent() function.
You can remove a handler that has been previously registered by calling the event target’s
removeEventListener()
function. The parameters you pass to this function must be identical to those
passed to the addEventListener()
call that registered the handler. Typically, a script would register all event
handlers during initialization, and unregister them during termination; however, unregistering handlers
on termination is not required.
You can register for an event in a parent or ancestor object of the actual target; see the following section.
The predefined types of
UIEvent correspond to the event callbacks, as follows:
In addition, ScriptUI implements all types of W3C events according to the W3C DOM level 3 functional
specification (http://www.w3.org/TR/DOM-Level-3-Events/events.html
), with these modifications and
exceptions:
X ScriptUI does not implement the hasFeature() method of the DOMImplementation interface; there
is no way to query whether a given W3C DOM feature is implemented in ScriptUI.
X In ScriptUI, the W3C EventTarget interface is implemented by UI element objects (such as Button,
Window, and so on).
X In ScriptUI, the W3C AbstractView object is a UI element (such as Button, Window, and so on).
X None of the "namespace" properties or methods are supported (such as initEventNS and
initMouseEventNS).
Callback UIEvent type
onChange change
onChanging changing
onClick click (detail = 1)
onDoubleClick click (detail = 2)
onEnterKey enterKey
onMove move
onMoving moving
onResize resize
onResizing resizing
onShow show
onActivate focus
onDeactivate blur
Vista de pagina 82
1 2 ... 78 79 80 81 82 83 84 85 86 87 88 ... 303 304

Comentarios a estos manuales

Sin comentarios