# Passing a Property as Parameter

**URL:** <https://forum.kirupa.com/t/passing-a-property-as-parameter/82219>\
**Category:** flash\
**Created:** [March 8, 2005, 5:44pm UTC](https://forum.kirupa.com/t/passing-a-property-as-parameter/82219 "2005-03-08T17:44:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flashead](https://avatars.discourse-cdn.com/v4/letter/f/46a35a/32.png) [@flashead](https://forum.kirupa.com/u/flashead)\
**Post date:** [March 8, 2005, 5:44pm UTC](https://forum.kirupa.com/t/passing-a-property-as-parameter/82219/1 "2005-03-08T17:44:33Z")

</div>

I’m stumped on this…  
I have a function that I want to use to change either the \_x and \_y or the \_width and \_height. Rather than writing a separate function for each.

For example, instead of writing this…

```auto
 function changeMC(clip) { 
	 clip._x = 50;
	 clip._y = 50;
}

```

I want it to work kinda like this…

```auto
 function changeMC(clip, unitA, unitB) {
	 clip.unitA = 50;
	 clip.unitB = 50;
}
// and I'd call it with something like...
 
changeMC(this, _width, _height); // OR......
changeMC(this, _x, _y);

```

My problem is, when I call the function as I wrote it above, Flash naturally takes the \_width and \_height Values (ie. 432, or whatever the width and height may be), instead of literally putting ‘\_width’ or ‘\_height’ where the params are found throughout the function…

Hope that made sense 🙂 If not I’ll try to elaborate.  
Thanks!
