开发者

Custom primitives in actionscript

Is there a way to do something like that?

var myPrim:MyPrimitive = MyPrimitive(null);

if(myPrim == true){

}
else if(myPrim == fals开发者_JAVA百科e){

}
else if(myPrim == null){

}

Thanks in advance


Well a primitive, by definition, is built as part of the programming language. A custom primitive sounds like a paradox to me.

there is no way to create a new class that can be treated like a primitive.

You can create your own ActionScript class to accomplish what you want, however it wouldn't be treated like a primitive, and your conditional checking would have to check a property in the class, not the class itself.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜