snipt

Ctrl+h for KB shortcuts

JavaScript

jquery > show events attached to an element

$._data( $('.element')[0], 'events' );
https://snipt.net/embed/a1984e379d344581edbd5f7ae0fde037/
https://snipt.net/raw/a1984e379d344581edbd5f7ae0fde037/
a1984e379d344581edbd5f7ae0fde037
js
JavaScript
2
2016-09-22T05:37:09
True
False
False
/api/public/snipt/103123/
jquery-show-events-attached-to-an-element
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nx">$</span><span class="p">.</span><span class="nx">_data</span><span class="p">(</span> <span class="nx">$</span><span class="p">(</span><span class="s1">&#39;.element&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">],</span> <span class="s1">&#39;events&#39;</span> <span class="p">);</span> </span></pre></div> </td></tr></table>
events, javascript, jquery

ActionScript 3

Detect keypress in ActionScript

1
2
3
4
5
6
Stage.addEventListener(keyboard.KEY_DOWN, handleKeypress);

function handleKeypress(e:keyboardEvent):void
{
	trace(event.keyCode);
}
https://snipt.net/embed/17efc3464e25284ce3e51d42aab17cdb/
https://snipt.net/raw/17efc3464e25284ce3e51d42aab17cdb/
17efc3464e25284ce3e51d42aab17cdb
as3
ActionScript 3
6
2016-09-25T10:44:30
True
False
False
/api/public/snipt/18436/
detect-keypress-in-actionscript
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="n">Stage</span><span class="o">.</span><span class="na">addEventListener</span><span class="o">(</span><span class="n">keyboard</span><span class="o">.</span><span class="na">KEY_DOWN</span><span class="o">,</span> <span class="n">handleKeypress</span><span class="o">);</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="kd">function </span><span class="nf">handleKeypress</span><span class="o">(</span><span class="n">e</span><span class="o">:</span><span class="kt">keyboardEvent</span><span class="o">):</span><span class="kt">void</span> </span><span id="L-4"><a name="L-4"></a><span class="o">{</span> </span><span id="L-5"><a name="L-5"></a> <span class="nf">trace</span><span class="o">(</span><span class="n">event</span><span class="o">.</span><span class="na">keyCode</span><span class="o">);</span> </span><span id="L-6"><a name="L-6"></a><span class="o">}</span> </span></pre></div> </td></tr></table>
actionscript, events, keyboard, keycode, keypress
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.