Many objects with 1 event listener

OK so i’ve got a whole bunch of similar boxes on the screen layed out in a grid type fashion, each is Box object. Each has an event listener attached to it waiting for an the mouse to go over that Box, they all call the same function. Is there a way to uniquely identify each box without writing seperate listener functions for each Box?

I feel like if i could add the event listener with an extra parameter to call with the listening function i’d be ok, but i can’t figure out how to do this.

Any help would be much appreciated, let me know if im headed in the wrong direction.

Thanks!

My code: (using Tweener libs and sandy3d libs)

[FONT=Courier New][SIZE=1]package {
import flash.display.Sprite;
import flash.events.;
import sandy.core.Scene3D;
import sandy.core.data.
;
import sandy.core.scenegraph.;
import sandy.materials.
;
import sandy.materials.attributes.;
import sandy.primitive.
;
import caurina.transitions.Tweener;

public class Lab extends Sprite {
    private var scene:Scene3D;
    private var camera:Camera3D;
    private var boxArray:Array;
    
    public function Lab()
    {
        boxArray = new Array();
        
        camera = new Camera3D( 300, 300 );
        camera.z = -400;
        camera.y = 150;
        
        var root:Group = createScene();
        scene = new Scene3D( "scene", this, camera, root );
        addEventListener( Event.ENTER_FRAME, enterFrameHandler );
    }
    
    private function createScene():Group
    {
        var g:Group = new Group();
        var t:TransformGroup = new TransformGroup();
        
        var materialAttr:MaterialAttributes = new MaterialAttributes( 
            new LineAttributes( 1, 0x000000, 0),
            new LightAttributes( true, 0.1)
        );
        var material:Material = new ColorMaterial( 0xFFCC33, 1, materialAttr );
        material.lightingEnable = true;
        var app:Appearance = new Appearance( material );
        
        
        for (var i=0;i<10;i++)
        {
            var tArr = new Array();
            for (var j=0;j<10;j++)
            {
                var box = new Box( "box",40,40,40);
                box.appearance = app;
                box.x = i*45;
                box.y = j*45;
                box.name = "box" + i + "by" + j;
                t.addChild(box);
                tArr.push(box);
            }
            boxArray.push(tArr);
        }
        
        for (i=0;i<10;i++)
        {
            for (j=0;j<10;j++)
            {
                boxArray*[j].container.addEventListener(MouseEvent.MOUSE_OVER,shrink);
            }
        }
        
        
        t.rotateX = 30;
        t.rotateY = 30;
        g.addChild(t);
        return g;
    }
    
    private function shrink(e:MouseEvent):void
    {
        // Shrink only the box the mouse was over
    }
    
    private function enterFrameHandler(e:Event):void 
    {
        scene.render();
    }
    
}

}
[/SIZE][/FONT]