0
votes

In my flash stage, I'm grouping images, textfields, and movie clips using the Modify > Group or Ctrl-G.

One MovieClip in that group is a "behavior controller" and changes the way images, text, etc. display inside that group.

Is there a way to grab all members of a given object's Group?

// Similar function, grabs all sibling objects within a MovieClip
var mcSiblings:Array = [];
for(var i:Number = 0; i < this.parent.numChildren; i++) {
  mcSiblings.push(this.parent.getChildAt(i));
}

// Theoretical functionality, grabs all siblings within a Group
var gSiblings:Array = [];
for(var i:Number = 0; i < this.group.length; i++) { // this.group doesn't exist
  gSiblings.push(this.group.getChildAt(i);
}

Is this even possible?

Right now, I'm looking at nesting all nodes inside a new movieClip, but this means I'll have to load my library up with movieClips. Not necessarily a problem, just cluttery and less convenient than Groups.

Thanks!

1

1 Answers

2
votes

Grouping objects is an IDE functionality that has nothing to do with actionscript. It's just some way to conveniently handle your graphics. You could manually store all display objects of your group in an array and loop through that to avoid having them to be inside a movieclip.