开发者

Check actionscript 3 variable type?

开发者 https://www.devze.com 2023-04-08 23:46 出处:网络
i have two objects[object MovieClip] [object ContentDisplay] i have to differentiate them abut i can\'t find a me开发者_运维问答thod in as3 check variable type, like in php have is_int...getQualifiedC

i have two objects [object MovieClip] [object ContentDisplay] i have to differentiate them abut i can't find a me开发者_运维问答thod in as3 check variable type, like in php have is_int...


getQualifiedClassName(obj); returns class name of given object

You can also check if object is for example a movieclip: if (obj is MovieClip) {/* do something */}


A similar strategy to is_int() would be to use the is keyword like this:

var mc:MovieClip = new MovieClip();

trace(mc is MovieClip); // true
trace(mc is String); // false
0

精彩评论

暂无评论...
验证码 换一张
取 消