Attaching movieclips inside movieclips
I spent two days figuring out why I can’t attach movieclips inside movieclips in my current Flash 8 project. Results were pretty insane. Couldn’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’t believe that solution will work on Flash 8, but hey – it does. :) (Happy! Happy!)
So, if you want to declare movieclip variable and attach movie clip at the same time, I would recommend using the following code:
var str:String = “identifier”;
tools.attachMovie(str,str,tools.getNextHighestDepth(),{_x: -50});
var mc:MovieClip = tools[str];
rather than:
var str:String = “identifier”;
var mc:MovieClip = tools.attachMovie(str,str,tools.getNextHighestDepth(),{_x: -50});