I could easily do this in Excel, but thought I’d set myself a challenge and one massive learning curve lol.
I have a function that is started on the click of a MC, which builds a menu dynamically.
The function creates a MC for each child that is under a particular parent within an XML file - this works fine. At the begining of the function, it checks to see if an array contains any values (as the MC’s are added to the stage, the name of the MC is added into an array). If the array contains values, then a loop starts to remove the previously created MC’s. This is so that if 1 parent has 4 child elements, the next parent that is selected (if it has 3 child elements), won’t show its 3 child elements plus the previous parent’s 4th child … if that makes sense?
The problem I’ve got is removing the child. It seems that it cannot be removed as it can’t relate the array value to an instance/MC name. Even though as the child is added to the stage, an instance name of that child is set.
I’ve tried creating a new MC, and given it the name of the current array value, just before the removeChild happens, but that doesn’t work either
Any suggestions ?