[haXe] AS3 cannot handle properties?

Cons T Åhs cons at uplayme.com
Mon Jul 2 13:25:55 CEST 2007


Hi,
when generating as3 from haXe I see the following.

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

Generated as3 code:
		public var x : String;
		public function getX() : String {
			return "x: " + this.x;
		}
		public function setX(s : String) : String {
			this.x = StringTools.trim(s);
			return s;
		}

x has become a simple field, so accessing x will just return the  
value without the prefix generated by getX().  Is this a bug in haXe - 
 > as3 or a bug in as3, ie, there is no corresponding construct in  
as3?  Easy to workaround by using getX() and setX(), but properties  
are very neat.

Regards,
Cons



More information about the Haxe mailing list