Try:

//
-------------------------------------------------------------------------------------------------------------------
myCube.name = "yaabbba dabbaaaa doooooo!";
myCube.addEventlistener(MouseEvent3D.MOUSE_DOWN, getName);
//
-------------------------------------------------------------------------------------------------------------------


//
-------------------------------------------------------------------------------------------------------------------
private function getName(e:MouseEvent3D):void
{
   var myCube:Cube = e.target as Cube;
   trace(myCube.name);
}
//
-------------------------------------------------------------------------------------------------------------------



D







On 21 July 2010 13:20, le_unam <[email protected]> wrote:

> Hey guys how to receive the name of an object? i think mouseevent3d
> must be the right way but i dont know the details.
>
> when i create a cube with the name myCube and i want to trace the name
> of the cube when i click on it ...
>
> myCube.addEventlistener(MouseEvent3D.MOUSE_DOWN, getName);
>
> ---------------------------------------
> function getName(e:MouseEvent3D):void
> {
>        trace(e.object);
> }
> ---------------------------------------
>
> i tried some things like this but nothing will work. whats the right
> way?
>
> greetz

Reply via email to