I need some help! I have no doubt this is a dumb problem that I've just over-thought to the point I got dumb about it.
I've got one "main" instance of a MovieClip symbol (let's call it Mountain) with an accompanying class. In the flow of the program, I automatically generate 8 other instances of the same symbol, let's say, each has a different fill color. When i click one of those automatically generated ones, I wanted the main instance to change color to whatever color the automatically generated one was.
So after dynamically generating the item in a different class, I added an eventListener for MouseClick
var thisMountain=new Mountain;
thisMountain.ChangeColor();
thisMountain.addEventListener(MouseEvent.CLICK, itemClicked);
this.addChild(thisMountain);
But that's when I realized that the eventListener had no way to tell the function it's calling, WHICH instance of the symbol was clicked on. So I went and added the event listener into the "Mountain" class, but then it's being called even when the main one is clicked on. So I added a boolean when the instance is created to differentiate, but that seems like awful awful coding.
So what should I do? Is that example clear? Should I just make yet ANOTHER class that extends the mountain class or something? What is the best way to go about doing this?