I need a way to “extend” or proxy the Number class in ActionScript.
Basically I’ll overload the toString method of it.
But the Numbers should remain comparable with “<” and “>” operators.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t extend Number. The class if marked final:
http://livedocs.adobe.com/flex/3/langref/Number.html
Number, as best I understood it, is more like a primitive to the flash player, not a class that can be morphed to our own needs.
I would not expect there to be a way to proxy the class while also retaining the ability to do ‘>’ or ‘<‘ comparisons unless you write your own “greaterThan’ and “lessThan’ methods.