In this example we are going to assign a single click handler to several objects. The click handler is to create an instance of a symbol, which name is the same as the object being clicked.
This is how:
for(var i=0; i < Palette.numChildren; i++) { Palette.getChildAt(i).addEventListener(MouseEvent.CLICK, handleClick); }
function handleClick(e:MouseEvent) { //trace(e.target.name); var LargeShape:Class = getDefinitionByName(e.target.name) as Class; var myShape = new LargeShape(); addChild(myShape); }