# AS3 - calling get/set functions within a class

**URL:** <https://forum.kirupa.com/t/as3-calling-get-set-functions-within-a-class/196591>\
**Category:** flash\
**Created:** [August 9, 2006, 4:48pm UTC](https://forum.kirupa.com/t/as3-calling-get-set-functions-within-a-class/196591 "2006-08-09T16:48:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ignitrix](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ignitrix/32/2664_2.png) [@ignitrix](https://forum.kirupa.com/u/ignitrix)\
**Post date:** [August 9, 2006, 4:48pm UTC](https://forum.kirupa.com/t/as3-calling-get-set-functions-within-a-class/196591/1 "2006-08-09T16:48:22Z")

</div>

ActionScript 3.0, Flash 9 Public Alpha

I’m making use of custom get & set functions within my class. For example:

public function set myProperty( newValue:Number ):void  
{  
// do custom stuff  
\_myProperty = newValue;  
}

these work beautifully when I call myObjectName.myProperty = 10; from outside my class. However, what if I want to execute this function from within my class without cutting and pasting all of the code redundantly into another internal function? I tried this.myProperty = 10, but it didn’t work (it properly changed the value, it just doesn’t execute the set function).

Thanks!  
~JC
