hereson2 发表于 2013-1-27 05:03:18

as3里的判断变量是否为空...

as3里的判断变量是否为空.
1)object 
var a={};
trace(a.id==undefined); //true  (其中id是真实要付的属性 )
2)array:
var b=[];
trace(b==undefined) //true
注:在as3中,b.id==undefined是会报错的,而在as2中,是可以通过的
3)string
var c=new String()
trace(c=="")  //true
4)number
var d=new Number()
trace(d=="") //true 
5)arrayCollection
var a:ArrayCollection=new ArrayCollection()
   trace(a.length==0)  //true
页: [1]
查看完整版本: as3里的判断变量是否为空...