# AS3: Override setters getters dilema

**URL:** <https://forum.kirupa.com/t/as3-override-setters-getters-dilema/196612>\
**Category:** flash\
**Created:** [August 9, 2006, 7:54pm UTC](https://forum.kirupa.com/t/as3-override-setters-getters-dilema/196612 "2006-08-09T19:54:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jwopitz](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jwopitz/32/1556_2.png) [@jwopitz](https://forum.kirupa.com/u/jwopitz)\
**Post date:** [August 9, 2006, 7:54pm UTC](https://forum.kirupa.com/t/as3-override-setters-getters-dilema/196612/1 "2006-08-09T19:54:02Z")

</div>

In AS2 my class (which extended the MC) had setters and getters for x, y, z and would then make calculations and set the instance’s \_x, \_y values based on what I set as x, y, & z. It worked beautifully.

In AS3, I am extending Sprite. Now I had planned to use the same getter and setters, but since Adobe/MM deprecated the \_x, \_y props for x, y (which I am glad they did), it presents a new problem.

How in the hell can I do this:

```auto
public function set x (newValue:Number):Void {
      this.x = calculateNewX (newValue):Number;
      //used to be this._x = calculateNewX (newValue):Number;
}

```

Maybe the answer is painfully obvious such as just reverse your desired accessors to \_x, \_y, \_z. Well darnit, I would like not to do that. Any other suggestions.
