Ok, now its clearer =)
I remember doing something similar one. I had one AS3 generated object and
needed to use various copies of it with different material applications. The
structure of a generated object can be pretty complex, what you have is a
bunch of meshes and a bunch of materials and each material can be applied to
multiple meshes.
So, you can do something like this:
for each(var mdata:MaterialData in obj.materialLibrary)
{
if(mdata.name == "theOneImLookingFor")
mdata.material = new WireColorMaterial();
}
I'm not sure about "if(mdata.name == "theOneImLookingFor")", but you can use
any properties of material data to identify what you are looking for. Once
the material in the material data object is changed, all the meshes that
were linked to such mdata will be updated with your new material, without
you caring to id the meshes themselves.
Hope it helps,
Li