1 Reply Latest reply on Jun 10, 2006 3:29 PM by cousinlarry

    attachMovie in MovieClip extended class

    cousinlarry
      Hi all,

      Working with a class that extends MovieClip. I'd like to dynamically make children movie clips nested within the parent clip. I'm doing something like this [see bottom]:

      Problem is it only draws the last child movie clip stuff (this["clip"+i]).

      When I follow it in the debugger, it *does* attach (and draw) each clip in the sequence and add it to the movie clip tree on in the debugger with a unique "child"+i identifier. However, as soon as attachMovie() is called in the next iteration of the addChildren method loop it trashes the previous clip, as in, it's no longer attached to the parent. So the end result is that I only have one attached child clip, the i'th one that's drawn. Each new attachMovie replaces the previously attached movieclip.

      Am I misunderstanding how to create child movie clips inside an extended MovieClip object? I thought that when you call attachMovie() inside an extended movieclip class it created another child for that clip, so you could have many movie clips all nested inside one large one. Any ideas?