Hey Alex

this appears to be a minor bug in the View3D class. Things have been fixed
and updated on the svn - if you update your code you should now get
materials returned in mouse events for simple color materials.

cheers!

Rob


On Thu, Nov 12, 2009 at 10:40 AM, colouredfunk
<[email protected]>wrote:

> I'm not sure about materials, but you could loop through the children
> of the 3ds file, and apply events to them...
>
>
>                        for each (var child:Object3D in room.children)
>                        {
>                                //trace("child " + child.name)
>                                if (child.name == "wall") {
>                                        //add event
>                                }
>
> I haven't tested this, but I think it should do the job.....??...
>
>
> On Nov 11, 7:17 pm, Alex Rico <[email protected]> wrote:
> > HI,
> >
> > I have loaded a collada file into my scene. It's a simple room with 4
> > walls and a floor, i need to add a mouse event to each wall of the
> > room, but i don't know if there's a way to add event listeners to the
> > materials (simple color materials) or the faces.
> > I have added a mouse event to the mesh and tried to use the 'material'
> > property but it returns a null value.
> >
> > mesh= (loader.handle as ObjectContainer3D).children[0];
> > mesh.addEventListener(MouseEvent3D.MOUSE_DOWN, onClickObject);
> >
> > private function onClickObject(e:MouseEvent3D){
> >         trace(e.material); //this trace null.
> >
> > }
> >
> > how could i add an event listener to each of the materials or the
> > faces in my mesh?
> >
> > Thanks for your help.
> >
> > Alex.
>



-- 
Rob Bateman
Flash Development & Consultancy

[email protected]
www.infiniteturtles.co.uk
www.away3d.com

Reply via email to