{"id":60,"date":"2006-10-04T16:16:06","date_gmt":"2006-10-04T14:16:06","guid":{"rendered":"http:\/\/www.nivas.hr\/blog\/2006\/10\/04\/attaching-movieclips-inside-movieclips\/"},"modified":"2006-10-04T16:21:06","modified_gmt":"2006-10-04T14:21:06","slug":"attaching-movieclips-inside-movieclips","status":"publish","type":"post","link":"https:\/\/www.nivas.hr\/blog\/2006\/10\/04\/attaching-movieclips-inside-movieclips\/","title":{"rendered":"Attaching movieclips inside movieclips"},"content":{"rendered":"<p>I spent two days figuring out why I can&#8217;t attach movieclips inside movieclips in my current Flash 8 project. Results were pretty insane. Couldn&#8217;t find answer anywhere on the net, and as my last resort I went to Macromedia livedocs (<a target=\"_blank\" href=\"http:\/\/livedocs.macromedia.com\/flash\/mx2004\/main_7_2\/wwhelp\/wwhimpl\/common\/html\/wwhelp.htm?context=Flash_MX_2004&#038;file=00001487.html\">livedocs<\/a>). There I saw a post dating from mid 2005. Didn&#8217;t believe that solution will work on Flash 8, but hey &#8211; it does. :) (Happy! Happy!)<br \/>\nSo, if you want to declare movieclip variable and attach movie clip at the same time, I would recommend using the following code:<\/p>\n<p>var str:String = &#8220;identifier&#8221;;<br \/>\ntools.attachMovie(str,str,tools.getNextHighestDepth(),{_x: -50});<br \/>\nvar mc:MovieClip = tools[str];<\/p>\n<p>rather than:<\/p>\n<p>var str:String = &#8220;identifier&#8221;;<br \/>\nvar mc:MovieClip = tools.attachMovie(str,str,tools.getNextHighestDepth(),{_x: -50});<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I spent two days figuring out why I can&#8217;t attach movieclips inside movieclips in my current Flash 8 project. Results were pretty insane. Couldn&#8217;t find answer anywhere on the net, and as my last resort I went to Macromedia livedocs (livedocs). There I saw a post dating from mid 2005. Didn&#8217;t believe that solution will&#8230;<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,2],"tags":[],"_links":{"self":[{"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/posts\/60"}],"collection":[{"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/comments?post=60"}],"version-history":[{"count":0,"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/posts\/60\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/media?parent=60"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/categories?post=60"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/tags?post=60"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}