I knew it was something like that and probably didn't get syntax correct. After searching this forum I came on a little code from one the pros advice and used this:
array[objid].ObjectContainer3D.children[0].material = newcolour; (There's only one mesh per container so children[0] works, they didn't have names assigned so I couldn't call them) Next I'll try applying a name before they get put into an array. Thanks!!! On Sep 11, 12:40 pm, Rob Bateman <[email protected]> wrote: > you can easily grab a mesh object (or any object3d) that is attached to a > scene by using the name property: > > meshfaces.name = "myMeshFaces"; > > and then using the getChildByName() method on the scene. this function is > recursive, so it will step through all nested objects to find where your > mesh object is: > > meshfaces = scene.getChildByName("myMeshFaces"); > > when using the name property, be sure to create unique names for each mesh > you want to identify! > > hth > > Rob > > > > > > On Thu, Sep 10, 2009 at 4:45 AM, doyaydesign <[email protected]> wrote: > > > I'm parsing xml to create 6 meshes and put them into an array. I have > > to target them like this: > > > array[objcounter] = new Object; > > array[objcounter].ObjectContainer3D = new ObjectContainer3D > > (meshfaces); > > view.scene.addChild(array[objcounter].ObjectContainer3D); > > > array[getobjid].ObjectContainer3D.dosomething; > > > I'm not sure if going about this the right way (but its working), but > > I can't change the material. > > I give meshfaces a ColorWireMaterial at first but later I need to > > apply another color based on xml node with this kind of value > > "0xFFFFFF" > > > How do I target the mesh in the array? > > > Thanks for your support > > Jim > > -- > Rob Bateman > Flash Development & Consultancy > > [email protected] Hide quoted > text - > > - Show quoted text -
