1 Reply Latest reply on Apr 27, 2007 10:20 AM by parallaxed

    Extening Data Types

      Greetings, I was wondering, how do i extend a datatype when writing a class?

      I want to write the class toBool for integers, but i can't seem to extend datatype "int".

        • 1. Re: Extening Data Types
          ints in flex are already coearced to bools when evaluted in a conditional, as in perl, i.e. all nonzero integers = true.

          Int's are built-in. I don't think it's possible to extend them in the way suggested. You could just wrap the data in a type of your own, and create the toBool() method if more in-depth evaluation of your value is required.