in fact i will be able to have the material name whan i rollover it... but nevermind i find an other way to do what im looking for. thanks for your help
On 20 juil, 17:40, Peter Kapelyan <[email protected]> wrote: > whoops I wrote that when I was sleepy, sorry :O > > maybe event.target.children ? > > I was hoping you'd be able to get at least the children names, so you can > then maybe access each one. > > -Pete > > > > On Mon, Jul 20, 2009 at 11:34 AM, CUfon <[email protected]> wrote: > > > return that there a no property "children" on mouseevent3D > > > On 20 juil, 15:13, Peter Kapelyan <[email protected]> wrote: > > > Can you try something like: > > > > trace(event.children); > > > > On Mon, Jul 20, 2009 at 3:57 AM, CUfon <[email protected]> wrote: > > > > > Thanks for you suggest > > > > but i dont understand something > > > > here is my code: > > > > > var room = Collada.load("floor0.dae",{materials: > > > > {urgenceID:colorShad1,Color_A06ID:colorShad2},autoLoadTextures : > > > > false,scaling:0.005}); > > > > room.addOnSuccess(onLoaderSuccess); > > > > > function onLoaderSuccess(event:LoaderEvent):void{ > > > > room = ObjectContainer3D(event.loader.handle); > > > > room.addOnMouseOver(onMouseOverOnObject); > > > > View.scene.addChild(room); > > > > } > > > > > function onMouseOverOnObject(event:MouseEvent3D):void { > > > > var object:Object3D = event.object; > > > > var myMesh = event.object as Mesh > > > > trace(myMesh.material) > > > > } > > > > > this always return "null"...and i don't understand why > > > > can you help me ? > > > > > On 15 juil, 18:13, Rob Bateman <[email protected]> wrote: > > > > > Hey Cyril > > > > > > the MouseEvent3D returns a property "material" which is the material > > > > > instance you have rolled over in the mesh. if you use an if statement > > in > > > > > your listener, you can check which instance is which by comparing it > > to > > > > all > > > > > material instances: > > > > > > if (mouseEvent3D.material is myFirstMaterial) > > > > > ...do something > > > > > else if (mouseEvent3D.material is mySecondMaterial) > > > > > ...do something else > > > > > else if (mouseEvent3D.material is myThirdMaterial) > > > > > ...etc > > > > > > I agree that keeping a name property in the material object would > > help > > > > > though - will look into implementing that in the future > > > > > > cheers > > > > > > Rob > > > > > > On Fri, Jul 10, 2009 at 7:58 AM, Away3D <[email protected]> wrote: > > > > > > > The problem is that i will have a lot of room (it will be a plan of > > an > > > > > > hospital) and i can't name my mesh in sketchup...so it will be > > very > > > > > > long to setup correct information on correct room: > > > > > > I will have to trace each mesh name and associated the room > > action.... > > > > > > and find for example " mesh12 = urgency " it will be very long.... > > > > > > an another trouble is that my room have commun plan so 1mesh can be > > 2 > > > > > > or more room... > > > > > > It will be very easier if i can use material: in sketuchup i define > > > > > > the name of material with the name of a service and apply action > > for > > > > > > one color... > > > > > > > I see in the api an intersting property which is > > "view.mouseMaterial" > > > > > > but i haven't find the way to use it.... > > > > > > thanks > > > > > > > On 9 juil, 21:41, ben <[email protected]> wrote: > > > > > > > Hi Cyril ! > > > > > > > " implement differente action on each room/material " > > > > > > > well if you won't change the material, why not use the mesh as > > > > > > > reference for your actions ?? > > > > > > > > Object3D(yourMesh).addOnMouseOver(action); > > > > > > > > function action(e:MouseEvent3D):void > > > > > > > { > > > > > > > var id:String = e.target.name; > > > > > > > switch(id){ > > > > > > > case "horseAss": > > > > > > > kickit(); > > > > > > > break; > > > > > > > case " LauraBushAss" > > > > > > > kickItTwice(); > > > > > > > break; > > > > > > > case " CarlaAss" > > > > > > > kickItTen(); > > > > > > > break; > > > > > > > default: > > > > > > > trace(e.target.name); > > > > > > > } > > > > > > > > } > > > > > > > > if not, I know that a materialData (including name property) do > > > > exist, > > > > > > > but don't know how to access it... take a look at the API ! > > > > > > -- > > > > > Rob Bateman > > > > > Flash Development & Consultancy > > > > > > [email protected] > > > > -- > > > ___________________ > > > > Actionscript 3.0 Flash 3D Graphics Engine > > > > HTTP://AWAY3D.COM > > -- > ___________________ > > Actionscript 3.0 Flash 3D Graphics Engine > > HTTP://AWAY3D.COM
