well i was a little fast ^^

now i can get the name but this doesnt help because i want to change
the position of the clicked object. sorry now i realize i told you not
the details before. All i want to do is to change the position of the
clicked object with the arrow keys. So how can i get access to the
object.

On 21 Jul., 15:00, Darcey Lloyd <[email protected]> wrote:
> 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