Erain 3D
advert here

How to catch events in Sandy

Sandy is offering a possiblility to get the 3D object container, which is an AS3 DisplayObject ( a Sprite).

Most of people would use this property access to register some events onto the 3D object.
But this is NOT the best way to register events with Sandy3D.

For example : when you decide to augment the quality of sorting, and set :

myObject.useSingleContainer = false;

The container property does not link to any visual object anymore.

What is the solution?

Here is the common way to subscribe to an event in Sandy :

 
myShape = new Sphere("sphere");
myShape.useSingleContainer = false;
myShape.enableEvents = true;
myShape.addEventListener( MouseEvent.CLICK, onClick );
 
function onClick( p_eEvent:BubbleEvent ):void
{
            var l_oPoly:Polygon = ( p_eEvent.target as Polygon );
            var lShape:Shape3D = l_oPoly.shape;
}