# Does it recieve a reference or a copy?

**URL:** <https://forum.kirupa.com/t/does-it-recieve-a-reference-or-a-copy/282336>\
**Category:** flash\
**Created:** [February 20, 2009, 12:24pm UTC](https://forum.kirupa.com/t/does-it-recieve-a-reference-or-a-copy/282336 "2009-02-20T12:24:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![grandpaw\_broon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/grandpaw_broon/32/3985_2.png) [@grandpaw\_broon](https://forum.kirupa.com/u/grandpaw_broon)\
**Post date:** [February 20, 2009, 12:24pm UTC](https://forum.kirupa.com/t/does-it-recieve-a-reference-or-a-copy/282336/1 "2009-02-20T12:24:32Z")

</div>

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?
