2。0从头开始

      action scrip 2005-7-12 22:12
static 实例无法访问,只能通过隐式获取,如果想改变它的值,只能通过隐式设置
class a{
public static var i:Number=5;
}
mya =new a();
trace(mya.i);//undefined
class a{
public static var i:Number=5;
function get _z():Number{
return i;
}
mya=new a();
trace(mya._z);//5;
class a{
public static var i:Number=5;
function set _z(n:Number):Void{
gravity=n;
}
function get _a():Number{
return gravity;
}
}
mya =new a();
mya._z=10;
trace(mya._a);//10
标签集:TAGS:
回复Comments() 点击Count()

回复Comments

{commentauthor}
{commentauthor}
{commenttime}
{commentnum}
{commentcontent}
作者:
{commentrecontent}