0

Is there a way to do something like that?

var myPrim:MyPrimitive = MyPrimitive(null);

if(myPrim == true){

}
else if(myPrim == false){

}
else if(myPrim == null){

}

Thanks in advance

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

looks like i will have to stick with property checking. Thanks for the prompt reply :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.