
Код AS3:
private var hash:Dictionary=new Dictionary();
...
var i:int=10;
while (i--){
var mc:SomeSprite=new SomeSprite();
mc.addEventListener(MouseEvent.CLICK, onClick);
super.addChild(mc);
mc.x=100*i;
hash[mc]=i;
}
...
private function onClick(event:MouseEvent):void{
trace(hash[event.currentTarget]);
}