as3的get,set方法实现
as3的get,set方法实现
public function initApp():void
{
var v1:Vv = new Vv();
v1.nameStr = "xxx";
trace(v1.nameStr);
}
package
{
public class Vv
{
private var _nameStr:String;
public function Vv()
{
}
public function get nameStr():String
{
return _nameStr;
}
public function set nameStr(aa:String):void
{
this._nameStr = aa;
}
}
}