title: Flash, ActionScript 3: using get/set properties to get values from other classes creates much duplicate code can it different?`
body: <p>i am using get and setters in my as3 code to edit values of an other class (because those variables are shared) i dont like to put stage.sharedVar.isScrabble in my code every time to change a variable so i used get/set functions</p>
  
  <p>see below</p>
  
  <pre><code>private function get isScrabble(){return stage.sharedVar.isScrabble;} 
  private function set isScrabble(val){stage.sharedVar.isScrabble = val;}  
  
  private function get superGrid(){return stage.sharedVar.superGrid} 
  private function set superGrid(val){stage.sharedVar.superGrid = val;} 
  
  private function get gridSize(){return stage.sharedVar.gridSize} 
  private function set gridSize(val){stage.sharedVar.gridSize = val}
  
  private function get blokDefaultWidth(){return stage.sharedVar.blokDefaultWidth} 
  private function set blokDefaultWidth(val){stage.sharedVar.blokDefaultWidth = val}
  
  private function get blokDefaultHeight(){return stage.sharedVar.blokDefaultHeight} 
  private function set blokDefaultHeight(val){stage.sharedVar.blokDefaultHeight = val}
  </code></pre>
  
  <p>as you van see it has a lot of duplicate code every time the "return stage.sharedVar." and the "stage.sharedVar."+ the value + " = val"  is constantly comming back.</p>
  
  <p>i was wondering is there a other way of creating these get/sets?
  something like?:</p>
  
  <pre><code>private function get variable1(){getValue("hisOwnFunctionName")} 
  private function set variable1(val){setValue("hisOwnFunctionName")}
  </code></pre>
  
  <p>and so on??</p>
  
  <p>thanks,
  Matthy</p>