views:

30

answers:

1

Hi,

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  A: 

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.

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