ActionScript Parameter Filtering

Posted by TheDarkIn1978 on Stack Overflow See other posts from Stack Overflow or by TheDarkIn1978
Published on 2010-06-09T17:26:08Z Indexed on 2010/06/09 19:02 UTC
Read the original article Hit count: 131

i'm setting up a custom class that accepts some Number parameters, but i need to limit those parameters and would like to know the best way of doing so.

currently, i'm simply calling if statements, and throwing an error if the number is above or below what's accepted. for example, there is a parameter that accepts and angle, but only between 0 and 90. in the case i've typed it as a uint so now i only have to check to see if it's above 90. there's also a parameter Number typed parameter that only accepts values between the range of 0.0 and 1.0.

is my method of using if statements and throwing erros the usual way of filtering parameters?

© Stack Overflow or respective owner

Related posts about actionscript-3

Related posts about parameters