I have an array (thanks to “stringy” on this forum!) of objects. The objects instances of movie clips that were attached to a container mc and then a loop was used to sort through the objects contained in container. This loop checks to see if the type of object is a movieclip. I’m trying to retrieve the name of each movieclip that is stored in the array as objects. How do I do this? Presently I’m getting [object object] rather than the name.
I’m thinking this is pretty straightforward and that there’s something small I’m missing here.
Here’s the loop:
function createarray() {
newarray = [];
for (var obj in container) {
if (typeof container[obj] == "movieclip") {
myNameIs = container[obj].name; //<- obviously no good but...
/****how do I get the name of obj in container?*****/
trace(container[obj].toString()); // <- gives me array numbers
newarray.push(container[obj]);
}
}
//trace(newarray.toString());
}
Rather than bug Stringy privately, I figured other people must have this question/problem as well. It seems to be a common thing.
Thanks to anyone kind enough to help out.