[haXe] AS3 cannot handle properties?

Hudson Ansley hudsonansley at gmail.com
Mon Jul 2 15:30:21 CEST 2007


AS3 does not allow return values on setters. So, maybe if your haXe code was:


   public var x(getX, setX): String;
   private function getX() {
         return "x: " + x;
   }
   private function setX(s: String) {
         x = StringTools.trim(s);
   }

it would equivalent to this in AS3:

private var _x:String;
public function get x(): String {
         return "x: " + x;
}
public function set x():void {
         x = StringTools.trim(s);
}

have not tried this, and I'm really not sure what haXe --> AS3 does
with the private var name of a getter/setter. Just speculating since
there is no way to actually use AS3 getter/setters to accomplish your
haXe code because of the setter return value.

Regards,
Hudson



More information about the Haxe mailing list