Hey,

Once you load or parse a model with Collada, the model should be an
ObjectContainer3D, so you can search like this:

for each(var child:Object3D in model.children)
{
  trace(child.name);
  //child.visible = false;
}

A more advanced, recursive search, with the ability to also search in nested
children should be something like this:

private function findChild(name:String, obj:ObjectContainer3D):Object3D
{
       var found:Object3D;
       for each(var child:Object3D in obj.children)
       {
           //Verify that the child has a name and that what you are looking
for is in that name.
           if(child.name && child.name.indexOf(name) != -1)
           {
               found = child;
               break;
           }

           //Check if the child can contain other children and also look in
them.
           if(child is ObjectContainer3D)
           {
               found = findChild(name, child as ObjectContainer3D);

               if(found)
                   break;
           }
       }

       return found;
}

Once you found the object, you can do whatever you want with it.

If you dont know what names to search, find the Debug class in the Away3D
api, import it in your project and use:

Debug.active = true;

before parsing or loading the collada file. You should see all the collada
information traced out. Oh, and of course, you can also look in the collada
file with a text editor!! duh

Hope it helps,
Li

On Tue, Dec 2, 2008 at 2:14 PM, msmooshoo <[EMAIL PROTECTED]> wrote:

>
> Hello. I'm trying to access the individual nodes in a Collada file so
> I can hide/show it. Meaning, the nodes listed under
> "library_visual_scenes" - "visual_scene" in the Collada's XML format.
> I want to be able to set the "visible" property to true/false for
> individual nodes... Any help would be appreciated. Thanks!

Reply via email to