Passing a Property as Parameter

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…

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

I want it to work kinda like this…

 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 :slight_smile: If not I’ll try to elaborate.
Thanks!