I have a class (called Units) that defines sprites which react to mouse events (being dragged around).
My main .as class (called Loader) imports the Units class, sets up several shapes from Units as objects into an array (my_array = new Units(j,k,l);) and then calls addChild in a loop to add them to the display list (addChild(my_array.shape);).
All fine and dandy, but if I want a shape to go to the top of the display list when dragged about, how do I do it? The problem is that the mouseEvent is in the Units.as class, but the addChild is in the Loader.as class.
The only thing I can think of is to strip the mouseEvent out of Units.as and add it to Loader.as - but that would mean adding an event to every shape in a loop, which seems inefficient.