MaterialsList

Kind of class:public class
Package:org.papervision3d.materials.utils
Inherits from:none
Classpath:org.papervision3d.materials.utils.MaterialsList
File last modified:Sunday, 02 March 2008, 15:23:22
The MaterialsList class contains a list of materials.

Each MaterialsList object has its own materials list.

Summary


Constructor
  • MaterialsList (materials:* = null) : void
    • Creates a list of materials.
Instance properties
Instance methods

Constructor

MaterialsList

public function MaterialsList (
materials:* = null) : void

Creates a list of materials.
Parameters:
materials:
An array or name indexed object with materials to populate the list with.

Instance properties

materialsByName

public materialsByName:Dictionary
(read,write)

List of materials indexed by name.

numMaterials

public numMaterials:int
(read)

Returns the number of children of this object.

Instance methods

addMaterial

public function addMaterial (
material:MaterialObject3D, name:String = null) : MaterialObject3D

Adds a material to this MaterialsList object.
Parameters:
material:
The material to add.
name :
An optional name of the material. If no name is provided, the material name will be used.
Returns:
  • The material you have added.

clone

public function clone (

Creates a copy of the materials list.
Returns:
  • A newly created materials list that contains a duplicate of each of its materials.

getMaterialByName

public function getMaterialByName (
name:String) : MaterialObject3D

Returns the material that exists with the specified name.

Parameters:
name:
The name of the material to return.
Returns:
  • The material with the specified name.

removeMaterial

public function removeMaterial (

Removes the specified material from the materials list.
Parameters:
material:
The material to remove.
Returns:
  • The material you have removed.

removeMaterialByName

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:
The name of the material to remove.
Returns:
  • The material object that was removed.

toString

public function toString (
) : String

Returns a string with the names of the materials in the list.
Returns:
  • A string.