This content has been marked as final. Show 4 replies
you would then refer to the instance by the instance name you are assigning in the attachMovie method (ie: box0, box1, box2) so at any time you can access that MC by the instance name given. however you can be more efficient in the loading and attachment methods by structuring it more like this:
Thanks for the help. This works if you have a set number of MCs and you
know from the start how many you will have. I'm trying to build something
more flexible. I was hoping that storing the "box"+i in a variable would work
to position the MCs, but it does not. I'm sure there is a way to store these
in an array and make it work, but I don't understand why a variable wouldn't
work just as well. Something like this:
no this is a dynamic method and will generate as many instances as there are nodes in the xml.
the reason that the variable is not working for you, is that the way you have it declared it is a String, not a MovieClip - and you do not need to reassign the instance name of the clip to a variable. additionally, you can set the position of the clip at the time of attachment by including an Init Object reference parameter in the attachMovie method.
also, it's never a bad idea to store the instance in an array for batch processing if needed, but you can still do so by referencing the instance of the clip as its genereated rather than using an unneeded variable reference.
all of these items would look something more like this:
Thanks again for the help. I can see how this should work. However I'm running CS3 on
Leopard and it performs strangely. Unfortunately after I added the load for my xml file
nothing is outputted.