Skip to main content
Known Participant
October 7, 2012
Question

Arrays of nested instances?

  • October 7, 2012
  • 1 reply
  • 469 views

Let's say I have an instance onstage called "Big". Inside of that instance are 3 instances called "small1","small2" and "small3".All 3 of these instances are copies of the same symbol and contain two frames. My goal is to put the instances in an array to control them. If the variable "maker" is equal to 1, "small1" should go to label 2, if "maker" is equal to 2, small2 to 2, etc.

This is not working:

var smallButtons:Array=[big.small1,big.small2,big.small3]

I've tried turning them into strings, this[], etc. Any ideas would be appreciated.

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
October 7, 2012

You said you have an instance named Big, but your code uses "big". 

Also, are the small instances added to Big manually or dynamically?  If they are added manually then your targeting should work.  If they are added dynamically, then you do not need the "big" part.

Lastly, what makes you say it is not working?  What is not working?  You haven't shown anything in the way of code that indicates what they are doing that might not be working.