Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

ActionScript 3

ActionScript 3 ClickTAG

1
2
3
4
clickTag_bn.addEventListener(MouseEvent.CLICK, onMouseClick);
function onMouseClick(event:MouseEvent):void {
    navigateToURL(new URLRequest(clickTAG), _blank); 
}
https://snipt.net/embed/9595470ee7b7ada0392707886b9081b3/
https://snipt.net/raw/9595470ee7b7ada0392707886b9081b3/
9595470ee7b7ada0392707886b9081b3
as3
ActionScript 3
4
2016-11-28T04:11:21
True
False
False
/api/public/snipt/20306/
actionscript-3-clicktag
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="n">clickTag_bn</span><span class="o">.</span><span class="na">addEventListener</span><span class="o">(</span><span class="n">MouseEvent</span><span class="o">.</span><span class="na">CLICK</span><span class="o">,</span> <span class="n">onMouseClick</span><span class="o">);</span> </span><span id="L-2"><a name="L-2"></a><span class="kd">function </span><span class="nf">onMouseClick</span><span class="o">(</span><span class="n">event</span><span class="o">:</span><span class="kt">MouseEvent</span><span class="o">):</span><span class="kt">void</span> <span class="o">{</span> </span><span id="L-3"><a name="L-3"></a> <span class="n">navigateToURL</span><span class="o">(</span><span class="k">new</span> <span class="kt">URLRequest</span><span class="o">(</span><span class="n">clickTAG</span><span class="o">),</span> <span class="err">“</span><span class="n">_blank</span><span class="err">”</span><span class="o">);</span> </span><span id="L-4"><a name="L-4"></a><span class="o">}</span> </span></pre></div> </td></tr></table>
actionscript

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-12-08T02:46:32
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></span><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

ActionScript

link flash ad from iFrame

1
2
3
on(release) {
	getURL("http://www.journalism.cuny.edu/", "_blank");
}
https://snipt.net/embed/78bb81876527e103f2630fa56135dae7/
https://snipt.net/raw/78bb81876527e103f2630fa56135dae7/
78bb81876527e103f2630fa56135dae7
as
ActionScript
3
2016-12-08T09:40:18
True
False
False
/api/public/snipt/11775/
link-flash-ad-from-iframe
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nx">on</span><span class="p">(</span><span class="nx">release</span><span class="p">)</span> <span class="p">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="nf">getURL</span><span class="p">(</span><span class="s2">&quot;http://www.journalism.cuny.edu/&quot;</span><span class="o">,</span> <span class="s2">&quot;_blank&quot;</span><span class="p">);</span> </span><span id="L-3"><a name="L-3"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
actionscript, flash, poynter

ActionScript 3

traceObject function, dump Object, print Object

1
2
3
4
5
6
7
private function traceObject(o:Object):void{
	trace('\n');
	for(var val:* in o){
		trace('   [' + typeof(o[val]) + '] ' + val + ' => ' + o[val]);
	}
	trace('\n');
}
https://snipt.net/embed/25ee7c4602a583c9a367ddebc64655bd/
https://snipt.net/raw/25ee7c4602a583c9a367ddebc64655bd/
25ee7c4602a583c9a367ddebc64655bd
as3
ActionScript 3
7
2016-12-09T05:13:45
True
False
False
/api/public/snipt/7082/
traceobject-function-dump-object-print-object
<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> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="kd">private</span> <span class="kd">function </span><span class="nf">traceObject</span><span class="o">(</span><span class="n">o</span><span class="o">:</span><span class="kt">Object</span><span class="o">):</span><span class="kt">void</span><span class="o">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="nf">trace</span><span class="o">(</span><span class="s1">&#39;\n&#39;</span><span class="o">);</span> </span><span id="L-3"><a name="L-3"></a> <span class="k">for</span><span class="o">(</span><span class="n">var</span> <span class="n">val</span><span class="o">:*</span> <span class="k">in</span> <span class="n">o</span><span class="o">){</span> </span><span id="L-4"><a name="L-4"></a> <span class="nf">trace</span><span class="o">(</span><span class="s1">&#39; [&#39;</span> <span class="o">+</span> <span class="k">typeof</span><span class="o">(</span><span class="n">o</span><span class="o">[</span><span class="n">val</span><span class="o">])</span> <span class="o">+</span> <span class="s1">&#39;] &#39;</span> <span class="o">+</span> <span class="n">val</span> <span class="o">+</span> <span class="s1">&#39; =&gt; &#39;</span> <span class="o">+</span> <span class="n">o</span><span class="o">[</span><span class="n">val</span><span class="o">]);</span> </span><span id="L-5"><a name="L-5"></a> <span class="o">}</span> </span><span id="L-6"><a name="L-6"></a> <span class="nf">trace</span><span class="o">(</span><span class="s1">&#39;\n&#39;</span><span class="o">);</span> </span><span id="L-7"><a name="L-7"></a><span class="o">}</span> </span></pre></div> </td></tr></table>
actionscript, as3
Copyrighted, illegal, or inappropriate content? Email [email protected].