40 lines
		
	
	
		
			23 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			23 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <!DOCTYPE html>
 | ||
| <html lang="en"><!-- use theme color or fallback -->
 | ||
| <!--use textcolor from settings, otherwise create a contrasting color to theme color-->
 | ||
| <head><meta charset="utf-8"/><link href="../../bootstrap/css/bootstrap.min.css" rel="stylesheet"/><link href="../../bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet"/><link href="../../bootstrap/css/bootstrap-select.min.css" rel="stylesheet"/><link href="http://fonts.googleapis.com/css?family=Open+Sans:400,700,700italic,400italic" rel="stylesheet" type="text/css"/><link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,600,600italic,400" rel="stylesheet" type="text/css"/><link href="http://netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.css" rel="stylesheet" type="text/css"/><script src="../../jquery-1.9.1.min.js"></script><script src="../../bootstrap/js/bootstrap.min.js"></script><script src="../../bootstrap/js/bootstrap-select.min.js"></script><link href="../../styles.css" rel="stylesheet"/><link href="../../haxe-nav.css" rel="stylesheet"/><script type="text/javascript">var dox = {rootPath: "../../",platforms: ["Neko","Android","Flash","iOS","macOS","Linux","HTML5","Windows"]};</script><script type="text/javascript" src="../../nav.js"></script><script type="text/javascript" src="../../index.js"></script><link rel="icon" href="../../favicon.ico" type="image/x-icon"></link><title>js.html.Event - API Reference</title><meta name="description" content="The <code><a href="../../js/html/Event.html">Event</a></code> interface represents any event which takes place in the DOM; some are user-generated (such as mouse or keyboard events), while others are generated by APIs (such as events that indicate an animation has finished running, a video has been paused, and so forth). There are many types of event, some of which use are other interfaces based on the main <code><a href="../../js/html/Event.html">Event</a></code> interface. <code><a href="../../js/html/Event.html">Event</a></code> itself contains the properties and methods which are common to all events."/></head><body><style>
 | ||
| a, code .type {
 | ||
| 	color: #24afc4;
 | ||
| }
 | ||
| .navbar .brand {
 | ||
| 	display: inline-block;
 | ||
| 	float: none;
 | ||
| 	text-shadow: 0 0 0 transparent;
 | ||
| }
 | ||
| .nav-list>.active>a.treeLink, .nav-list>.active>a.treeLink:hover, .nav-list>.active>a.treeLink:focus {
 | ||
| 	background: #24afc4;
 | ||
| 	color: #ffffff;
 | ||
| 	text-shadow: 0 0 0 transparent;
 | ||
| }
 | ||
| .navbar .container {
 | ||
| 	width: 940px ;
 | ||
| }
 | ||
| @media (max-width: 767px) {
 | ||
| 	.navbar .container {
 | ||
| 		width: auto;
 | ||
| 	}
 | ||
| }
 | ||
| @media (max-width: 979px) and (min-width: 768px) {
 | ||
| 	.navbar .container {
 | ||
| 		width: 724px;
 | ||
| 	}
 | ||
| }
 | ||
| @media (min-width: 1200px) {
 | ||
| 	.navbar .container {
 | ||
| 		width: 1170px;
 | ||
| 	}
 | ||
| }
 | ||
| .navbar .container img {
 | ||
| 	margin: 5px 0 0 4px;
 | ||
| }
 | ||
| </style><nav class="nav"><div class="navbar"><div class="navbar-inner" style="background:#FAFAFA; border-bottom:1px solid rgba(0,0,0,.09)"><div class="container"><a class="brand" href="http://www.openfl.org"><img alt="" src="http://www.openfl.org/images/logo.png"/></a><a class="brand" style="color:#777777" href="../../">API Reference</a></div></div></div></nav><div class="container main-content"><div class="row-fluid"><div class="span3"><div class="well sidebar-nav"><form class="form-search" id="searchForm"><div class="input-prepend input-block-level"><span class="add-on"><i class="icon-search"></i></span><input id="search" type="text" placeholder="Search" autocomplete="off"/></div></form><div class="dropdown"><select id="select-platform" class="selectpicker" title="Filter by platform" data-width="100%"><option value="all" selected="true">All Platforms</option><option>Neko</option><option>Android</option><option>Flash</option><option>iOS</option><option>macOS</option><option>Linux</option><option>HTML5</option><option>Windows</option></select></div></div><div class="well sidebar-nav"><div id="nav"></div></div></div><div class="span9"><div class="page-header"><h1><small>class</small> Event</h1><h4><small>package <a href="../../js/html/index.html">js.html</a></small></h4>    <h4><small><span class="muted">extended by </span><a class="type" title="The Web Audio API AudioProcessingEvent represents events that occur when a ScriptProcessorNode input buffer is ready to be processed." href="../../js/html/audio/AudioProcessingEvent.html">AudioProcessingEvent</a>, <a class="type" title="The Web Audio API OfflineAudioCompletionEvent interface represents events that occur when the processing of an OfflineAudioContext is terminated." href="../../js/html/audio/OfflineAudioCompletionEvent.html">OfflineAudioCompletionEvent</a>, <a class="type" title="The IDBVersionChangeEvent interface of the IndexedDB API indicates that the version of the database has changed, as the result of an IDBOpenDBRequest." href="../../js/html/idb/VersionChangeEvent.html">VersionChangeEvent</a>, <a class="type" title="The WebContextEvent interface is part of the WebGL API and is an interface for an event that is generated in response to a status change to the WebGL rendering context." href="../../js/html/webgl/ContextEvent.html">ContextEvent</a>, <a class="type" title="The AnimationEvent interface represents events providing information related to animations." href="../../js/html/AnimationEvent.html">AnimationEvent</a>, <a class="type" title="The beforeunload event is fired when the window, the document and its resources are about to be unloaded." href="../../js/html/BeforeUnloadEvent.html">BeforeUnloadEvent</a>, <a class="type" title="The ClipboardEvent interface represents events providing information related to modification of the clipboard, that is cut, copy, and paste events." href="../../js/html/ClipboardEvent.html">ClipboardEvent</a>, <a class="type" title="A CloseEvent is sent to clients using WebSockets when the connection is closed." href="../../js/html/CloseEvent.html">CloseEvent</a>, <a class="type" title="" href="../../js/html/CommandEvent.html">CommandEvent</a>, <a class="type" title="This interface inherits properties from its parent, Event: Documentation CustomEvent by Mozilla Contributors, licensed under CC-BY-SA 2." href="../../js/html/CustomEvent.html">CustomEvent</a>, <a class="type" title="" href="../../js/html/DOMTransactionEvent.html">DOMTransactionEvent</a>, <a class="type" title="The DeviceMotionEvent provides web developers with information about the speed of changes for the device's position and orientation." href="../../js/html/DeviceMotionEvent.html">DeviceMotionEvent</a>, <a class="type" title="The DeviceOrientationEvent provides web developers with information from the physical orientation of the device running the web page." href="../../js/html/DeviceOrientationEvent.html">DeviceOrientationEvent</a>, <a class="type" title="The ErrorEvent interface represents events providing information related to errors in scripts or in files." href="../../js/html/ErrorEvent.html">ErrorEvent</a>, <a class="type" title="The hashchange event is fired when the fragment identifier of the URL has changed (the part of the URL that follows the # symbol, including the # symbol)." href="../../js/html/HashChangeEvent.html">HashChangeEvent</a>, <a class="type" title="A MessageEvent is the interface representing a message received by a target, being a WebSocket or a WebRTC RTCDataChannel Documentation MessageEvent by Mozilla Contributors, licensed under CC-BY-SA 2." href="../../js/html/MessageEvent.html">MessageEvent</a>, <a class="type" title="Provides event properties that are specific to modifications to the Document Object Model (DOM) hierarchy and nodes." href="../../js/html/MutationEvent.html">MutationEvent</a>, <a class="type" title="" href="../../js/html/NotifyPaintEvent.html">NotifyPaintEvent</a>, <a class="type" title="Page transition events fire when a webpage is being loaded or unloaded." href="../../js/html/PageTransitionEvent.html">PageTransitionEvent</a>, <a class="type" title="An event handler for the popstate event on the window." href="../../js/html/PopStateEvent.html">PopStateEvent</a>, <a class="type" title="" href="../../js/html/PopupBlockedEvent.html">PopupBlockedEvent</a>, <a class="type" title="The ProgressEvent interface represents events measuring progress of an underlying process, like an HTTP request (for an XMLHttpRequest, or the loading of the underlying resource of an img, audio, video, style or link)." href="../../js/html/ProgressEvent.html">ProgressEvent</a>, <a class="type" title="" href="../../js/html/RecordErrorEvent.html">RecordErrorEvent</a>, <a class="type" title="The SpeechRecognitionError interface of the Web Speech API represents error messages from the recognition service." href="../../js/html/SpeechRecognitionError.html">SpeechRecognitionError</a>, <a class="type" title="The SpeechRecognitionEvent interface of the Web Speech API represents the event object for the result and nomatch events, and contains all the data associated with an interim or final speech recognition result." href="../../js/html/SpeechRecognitionEvent.html">SpeechRecognitionEvent</a>, <a class="type" title="The SpeechSynthesisEvent interface of the Web Speech API contains information about the current state of SpeechSynthesisUtterance objects that have been processed in the speech service." href="../../js/html/SpeechSynthesisEvent.html">SpeechSynthesisEvent</a>, <a class="type" title="A StorageEvent is sent to a window when a storage area changes." href="../../js/html/StorageEvent.html">StorageEvent</a>, <a class="type" title="Extends Event." href="../../js/html/TimeEvent.html">TimeEvent</a>, <a class="type" title="" href="../../js/html/TrackEvent.html">TrackEvent</a>, <a class="type" title="The TransitionEvent interface represents events providing information related to transitions." href="../../js/html/TransitionEvent.html">TransitionEvent</a>, <a class="type" title="The UIEvent interface represents simple user interface events." href="../../js/html/UIEvent.html">UIEvent</a></small></h4><p class="availability"><hr/><em>Available on  HTML5</em></p></div><div class="body"><div class="doc doc-main"><div class="indent"><p>The <code><a href="../../js/html/Event.html">Event</a></code> interface represents any event which takes place in the DOM; some are user-generated (such as mouse or keyboard events), while others are generated by APIs (such as events that indicate an animation has finished running, a video has been paused, and so forth). There are many types of event, some of which use are other interfaces based on the main <code><a href="../../js/html/Event.html">Event</a></code> interface. <code><a href="../../js/html/Event.html">Event</a></code> itself contains the properties and methods which are common to all events.</p>
 | ||
| <p>Documentation <a href="https://developer.mozilla.org/en-US/docs/Web/API/Event">Event</a> by <a href="https://developer.mozilla.org/en-US/docs/Web/API/Event$history">Mozilla Contributors</a>, licensed under <a href="https://creativecommons.org/licenses/by-sa/2.5/">CC-BY-SA 2.5</a>.</p><p class="javadoc">See:</p><div class="indent inline-content"><p><a href="https://developer.mozilla.org/en-US/docs/Web/API/Event">https://developer.mozilla.org/en-US/docs/Web/API/Event</a></p></div></div></div><h3 class="section">Constructor</h3><div class="fields"><div class="field "><a name="new"></a><h3><p><code><a href="#new"><span class="identifier">new</span></a> (<span style="white-space:nowrap">type:<a class="type" title="The basic String class." href="../../String.html">String</a>,</span> <span style="white-space:nowrap">?eventInitDict:<a class="type" title="" href="../../js/html/EventInit.html">EventInit</a></span>)</code></p></h3><div class="doc"><p class="javadoc">Throws:</p><table class="table table-bordered params"><div class="indent inline-content"><tr><th width="25%"><code>null</code></th><td><p>DOMError</p></td></tr></div></table></div></div></div><h3 class="section">Variables</h3><div class="fields"><div class="field "><a name="bubbles"></a><h3><p><code><span class="label">read only</span><a href="../../js/html/Event.html#bubbles"><span class="identifier">bubbles</span></a>:<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></code></p></h3><div class="doc"><p>A Boolean indicating whether the event bubbles up through the DOM or not.</p></div></div><div class="field "><a name="cancelable"></a><h3><p><code><span class="label">read only</span><a href="../../js/html/Event.html#cancelable"><span class="identifier">cancelable</span></a>:<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></code></p></h3><div class="doc"><p>A Boolean indicating whether the event is cancelable.</p></div></div><div class="field "><a name="currentTarget"></a><h3><p><code><span class="label">read only</span><a href="../../js/html/Event.html#currentTarget"><span class="identifier">currentTarget</span></a>:<a class="type" title="EventTarget is an interface implemented by objects that can receive events and may have listeners for them." href="../../js/html/EventTarget.html">EventTarget</a></code></p></h3><div class="doc"><p>A reference to the currently registered target for the event. This is the object to which the event is currently slated to be sent to; it's possible this has been changed along the way through retargeting.</p></div></div><div class="field "><a name="defaultPrevented"></a><h3><p><code><span class="label">read only</span><a href="../../js/html/Event.html#defaultPrevented"><span class="identifier">defaultPrevented</span></a>:<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></code></p></h3><div class="doc"><p>Indicates whether or not <code>event.preventDefault()</code> has been called on the event.</p></div></div><div class="field "><a name="eventPhase"></a><h3><p><code><span class="label">read only</span><a href="../../js/html/Event.html#eventPhase"><span class="identifier">eventPhase</span></a>:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></code></p></h3><div class="doc"><p>Indicates which phase of the event flow is being processed.</p></div></div><div class="field "><a name="explicitOriginalTarget"></a><h3><p><code><span class="label">read only</span><a href="../../js/html/Event.html#explicitOriginalTarget"><span class="identifier">explicitOriginalTarget</span></a>:<a class="type" title="EventTarget is an interface implemented by objects that can receive events and may have listeners for them." href="../../js/html/EventTarget.html">EventTarget</a></code></p></h3><div class="doc"><p>The explicit original target of the event (Mozilla-specific).</p></div></div><div class="field "><a name="isTrusted"></a><h3><p><code><span class="label">read only</span><a href="../../js/html/Event.html#isTrusted"><span class="identifier">isTrusted</span></a>:<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></code></p></h3><div class="doc"><p>Indicates whether or not the event was initiated by the browser (after a user click for instance) or by a script (using an event creation method, like event.initEvent)</p></div></div><div class="field "><a name="originalTarget"></a><h3><p><code><span class="label">read only</span><a href="../../js/html/Event.html#originalTarget"><span class="identifier">originalTarget</span></a>:<a class="type" title="EventTarget is an interface implemented by objects that can receive events and may have listeners for them." href="../../js/html/EventTarget.html">EventTarget</a></code></p></h3><div class="doc"><p>The original target of the event, before any retargetings (Mozilla-specific).</p></div></div><div class="field "><a name="target"></a><h3><p><code><span class="label">read only</span><a href="../../js/html/Event.html#target"><span class="identifier">target</span></a>:<a class="type" title="EventTarget is an interface implemented by objects that can receive events and may have listeners for them." href="../../js/html/EventTarget.html">EventTarget</a></code></p></h3><div class="doc"><p>A reference to the target to which the event was originally dispatched.</p></div></div><div class="field "><a name="timeStamp"></a><h3><p><code><span class="label">read only</span><a href="../../js/html/Event.html#timeStamp"><span class="identifier">timeStamp</span></a>:<a class="type" title="The standard Float type, this is a double-precision IEEE 64bit float." href="../../Float.html">Float</a></code></p></h3><div class="doc"><p>The time at which the event was created, in milliseconds. By specification, this value is time since epoch, but in reality browsers' definitions vary; in addition, work is underway to change this to be a <code>DOMHighResTimeStamp</code> instead.</p></div></div><div class="field "><a name="type"></a><h3><p><code><span class="label">read only</span><a href="../../js/html/Event.html#type"><span class="identifier">type</span></a>:<a class="type" title="The basic String class." href="../../String.html">String</a></code></p></h3><div class="doc"><p>The name of the event (case-insensitive).</p></div></div></div><h3 class="section">Methods</h3><div class="fields"><div class="field "><a name="getPreventDefault"></a><h3><p><code><a href="#getPreventDefault"><span class="identifier">getPreventDefault</span></a> ():<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></code></p></h3><div class="doc"><p>Non-standard. Returns the value of <code><a href="../../js/html/Event.html#defaultPrevented">Event.defaultPrevented</a></code>. Use <code><a href="../../js/html/Event.html#defaultPrevented">Event.defaultPrevented</a></code> instead.</p></div></div><div class="field "><a name="initEvent"></a><h3><p><code><a href="#initEvent"><span class="identifier">initEvent</span></a> (<span style="white-space:nowrap">type:<a class="type" title="The basic String class." href="../../String.html">String</a>,</span> <span style="white-space:nowrap">bubbles:<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a>,</span> <span style="white-space:nowrap">cancelable:<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></span>):<a class="type" title="The standard Void type." href="../../Void.html">Void</a></code></p></h3><div class="doc"><p>Initializes the value of an Event created. If the event has already being dispatched, this method does nothing.</p></div></div><div class="field "><a name="preventDefault"></a><h3><p><code><a href="#preventDefault"><span class="identifier">preventDefault</span></a> ():<a class="type" title="The standard Void type." href="../../Void.html">Void</a></code></p></h3><div class="doc"><p>Cancels the event (if it is cancelable).</p></div></div><div class="field "><a name="stopImmediatePropagation"></a><h3><p><code><a href="#stopImmediatePropagation"><span class="identifier">stopImmediatePropagation</span></a> ():<a class="type" title="The standard Void type." href="../../Void.html">Void</a></code></p></h3><div class="doc"><p>For this particular event, no other listener will be called. Neither those attached on the same element, nor those attached on elements which will be traversed later (in capture phase, for instance)</p></div></div><div class="field "><a name="stopPropagation"></a><h3><p><code><a href="#stopPropagation"><span class="identifier">stopPropagation</span></a> ():<a class="type" title="The standard Void type." href="../../Void.html">Void</a></code></p></h3><div class="doc"><p>Stops the propagation of events further along in the DOM.</p></div></div></div><h3 class="section">Static variables</h3><div class="fields"><div class="field "><a name="ALT_MASK"></a><h3><p><code><span class="label">static</span><span class="label">inline</span> <span class="label">read only</span><a href="../../js/html/Event.html#ALT_MASK"><span class="identifier">ALT_MASK</span></a>:<a class="type" title="The standard Int type." href="../../Int.html">Int</a><span> = 1</span></code></p></h3><div class="doc"><p></p></div></div><div class="field "><a name="AT_TARGET"></a><h3><p><code><span class="label">static</span><span class="label">inline</span> <span class="label">read only</span><a href="../../js/html/Event.html#AT_TARGET"><span class="identifier">AT_TARGET</span></a>:<a class="type" title="The standard Int type." href="../../Int.html">Int</a><span> = 2</span></code></p></h3><div class="doc"><p></p></div></div><div class="field "><a name="BUBBLING_PHASE"></a><h3><p><code><span class="label">static</span><span class="label">inline</span> <span class="label">read only</span><a href="../../js/html/Event.html#BUBBLING_PHASE"><span class="identifier">BUBBLING_PHASE</span></a>:<a class="type" title="The standard Int type." href="../../Int.html">Int</a><span> = 3</span></code></p></h3><div class="doc"><p></p></div></div><div class="field "><a name="CAPTURING_PHASE"></a><h3><p><code><span class="label">static</span><span class="label">inline</span> <span class="label">read only</span><a href="../../js/html/Event.html#CAPTURING_PHASE"><span class="identifier">CAPTURING_PHASE</span></a>:<a class="type" title="The standard Int type." href="../../Int.html">Int</a><span> = 1</span></code></p></h3><div class="doc"><p></p></div></div><div class="field "><a name="CONTROL_MASK"></a><h3><p><code><span class="label">static</span><span class="label">inline</span> <span class="label">read only</span><a href="../../js/html/Event.html#CONTROL_MASK"><span class="identifier">CONTROL_MASK</span></a>:<a class="type" title="The standard Int type." href="../../Int.html">Int</a><span> = 2</span></code></p></h3><div class="doc"><p></p></div></div><div class="field "><a name="META_MASK"></a><h3><p><code><span class="label">static</span><span class="label">inline</span> <span class="label">read only</span><a href="../../js/html/Event.html#META_MASK"><span class="identifier">META_MASK</span></a>:<a class="type" title="The standard Int type." href="../../Int.html">Int</a><span> = 8</span></code></p></h3><div class="doc"><p></p></div></div><div class="field "><a name="NONE"></a><h3><p><code><span class="label">static</span><span class="label">inline</span> <span class="label">read only</span><a href="../../js/html/Event.html#NONE"><span class="identifier">NONE</span></a>:<a class="type" title="The standard Int type." href="../../Int.html">Int</a><span> = 0</span></code></p></h3><div class="doc"><p></p></div></div><div class="field "><a name="SHIFT_MASK"></a><h3><p><code><span class="label">static</span><span class="label">inline</span> <span class="label">read only</span><a href="../../js/html/Event.html#SHIFT_MASK"><span class="identifier">SHIFT_MASK</span></a>:<a class="type" title="The standard Int type." href="../../Int.html">Int</a><span> = 4</span></code></p></h3><div class="doc"><p></p></div></div></div></div></div></div></div><footer class="section site-footer" style="background:#FAFAFA"><div class="container"><div class="copyright"><p style="color:#777777">© 2017  <a style="color:#777777" href="http://www.openfl.org">http://www.openfl.org</a></p></div></div></footer><script src="../..//highlighter.js"></script><link href="../../highlighter.css" rel="stylesheet"/></body></html> |