2007-06-08

describeType() 是判斷型別的好工具

flash.utils.describeType() 是判斷型別的好工具
Flash AS3:
var a:Object = 123;
var b:Object = 1e-1;
var c:Object = {a:1,b:2};
var d:Object = [5,4,3];
var e:Object = 'sss';
trace(describeType(a).@name);
trace(describeType(b).@name);
trace(describeType(c).@name);
trace(describeType(d).@name);
trace(describeType(e).@name);

Output:
int
Number
Object
Array
String

沒有留言:

FB 留言