The MaterialsList class contains a list of materials.
Each MaterialsList object has its own materials list.
protected var _materials:Dictionary
[internal-use] List of materials.
public var materialsByName:Dictionary
List of materials indexed by name.
numMaterials:int
[read-only]
Returns the number of children of this object.
Implementation
public function get numMaterials():int
public function MaterialsList(materials:* = null)
Creates a list of materials.
Parameters
| materials:* (default = null ) — An array or name indexed object with materials to populate the list with.
|
public function addMaterial(material:MaterialObject3D, name:String = null):MaterialObject3D
Adds a material to this MaterialsList object.
Parameters
| material:MaterialObject3D — The material to add.
|
|
| name:String (default = null ) — An optional name of the material. If no name is provided, the material name will be used.
|
Returns
public function clone():MaterialsList
Creates a copy of the materials list.
Returns
| MaterialsList —
A newly created materials list that contains a duplicate of each of its materials.
|
public function getMaterialByName(name:String):MaterialObject3D
Returns the material that exists with the specified name.
Parameters
| name:String — The name of the material to return.
|
Returns
public function removeMaterial(material:MaterialObject3D):MaterialObject3D
Removes the specified material from the materials list.
Parameters
Returns
public function removeMaterialByName(name:String):MaterialObject3D
Removes the material that exists with the specified name.
The material object is garbage collected if no other references to the material exist.
The garbage collector is the process by which Flash Player reallocates unused memory space. When a variable or object is no longer actively referenced or stored somewhere, the garbage collector sweeps through and wipes out the memory space it used to occupy if no other references to it exist.
Parameters
| name:String — The name of the material to remove.
|
Returns
public function toString():String
Returns a string with the names of the materials in the list.
Returns