• October 4, 2006

    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});

No comments yet.

Have your say:

 
This blog is Gravatar friendly. Don't have Gravatar? Get one fast!
 

Proudly running on Word Press, and above all, proudly using Comic Sans.

Nivas.hr © Copyright 2009    All right reserved    Made in Croatia Yeah, we made our own site!Nivas.hr