{"id":82,"date":"2008-11-05T00:00:22","date_gmt":"2008-11-05T07:00:22","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=75"},"modified":"2008-11-05T00:00:22","modified_gmt":"2008-11-05T07:00:22","slug":"click-listener","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=82","title":{"rendered":"Click Listener"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nvar e:String = &quot;addEventListener&quot;;\r\n\r\nstage&#x5B;e](&quot;click&quot;, function():void{\r\n\ttrace(&quot;clicked&quot;, arguments&#x5B;0]);\r\n});\r\n<\/pre>\n<p>Strange code to do a click listener. arguments[0] is the event object.  (Check out the &#8220;warning&#8221; page for more info about this).<\/p>\n<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nstage.addEventListener(MouseEvent.CLICK, onStageClick);\r\nfunction onStageClick(evt:MouseEvent):void {\r\n\ttrace(&quot;clicked&quot;, evt);\r\n}\r\n<\/pre>\n<p>Normal way.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>var e:String = &quot;addEventListener&quot;; stage&#x5B;e](&quot;click&quot;, function():void{ trace(&quot;clicked&quot;, arguments&#x5B;0]); }); Strange code to do a click listener. arguments[0] is the event object. (Check out the &#8220;warning&#8221; page for more info about this). stage.addEventListener(MouseEvent.CLICK, onStageClick); function onStageClick(evt:MouseEvent):void { trace(&quot;clicked&quot;, evt); } Normal way.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[],"class_list":["post-82","post","type-post","status-publish","format-standard","hentry","category-events"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/82","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=82"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/82\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=82"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=82"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=82"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}