Hi all,
Bit of a basic question again.
I had a situation where i need to pass in an object to an other object.
var material:Material = new Material();
material.setMaterialType(Material.TYPE_WOOD);
…
…
var materialDisplay:MaterialDisplay = new MaterialDisplay(material);
MaterialDisplay relies on a material instance for its information. However, the material type can change at any time.
The problem is, im not sure what is going on here. Does materialDisplay hold a reference to the material property or does it take a copy of material?
In other words, if the material type changes
material.setMaterialType(Material.TYPE_STEEL)
Will this change ripple though onto my existing materialDisplay? The last thing i want is for Wooden objects to now contain the properties of Steel objects.
When i subclass Event, i must override the clone() method but i dont think i know why this is. Should my material also have a clone() method?