开发者

Custom primitives in actionscript

开发者 https://www.devze.com 2023-01-17 17:16 出处:网络
Is there a way to do something like that? var myPrim:MyPrimitive = MyPrimitive(null); if(myPrim == true){

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

精彩评论

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

关注公众号