{"id":130,"date":"2008-12-21T03:25:23","date_gmt":"2008-12-21T10:25:23","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=400"},"modified":"2008-12-21T03:25:23","modified_gmt":"2008-12-21T10:25:23","slug":"bring-display-object-to-top","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=130","title":{"rendered":"Bring Display Object to Top"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nmc.addEventListener(MouseEvent.ROLL_OVER, onRollOver);\r\nfunction onRollOver(evt:MouseEvent):void {\r\n  addChild(MovieClip(evt.currentTarget));\r\n}\r\n<\/pre>\n<p>This one is very simple, but it&#8217;s important to note that using addChild() on something that is already on the display list simply brings it to the top. Back in AS2 we used to do:<\/p>\n<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nmc.swapDepths(1000);\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>mc.addEventListener(MouseEvent.ROLL_OVER, onRollOver); function onRollOver(evt:MouseEvent):void { addChild(MovieClip(evt.currentTarget)); } This one is very simple, but it&#8217;s important to note that using addChild() on something that is already on the display list simply brings it to the top. Back in AS2 we used to do: mc.swapDepths(1000);<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,6],"tags":[3,4],"class_list":["post-130","post","type-post","status-publish","format-standard","hentry","category-display-list","category-displayobject","tag-actionscript","tag-flash"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/130","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=130"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/130\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}