C# envy: properties
Recently I found out that in c#, if you want to put a variable behind a public getter and private setter, so that it can be read but not changed, you can do it on one line! Here it is:
public int x { get; private set; }
Or if you want both public, it would be:public int x { get; set; }
In ActionScript3 this would be:
The c# way is so much nicer - feature request Adobe!
private var _x:int;
public function get x():int
{
return _x;
}
public function set x(_x:int):void
{
this._x = _x;
}