One other way (there are tons of ways):
public static function isValidNumber(num:Number):Boolean {
switch (num) {
case 12:
case 34:
case 21:
case 46:
case 52:
return false;
}
return true;
}
(Of course, this assumes the list of numbers is static.)
Even if you don't use a switch statement, it's probably still a good
idea from an OOP standpoint to encapsulate this test in a function.
On 12/20/06, ben gomez farrell <[EMAIL PROTECTED]> wrote:
Eduardo Barbosa wrote:
> Hi all,
>
> given a list of numbers such as: (12, 34, 21, 46, 52 ... )
>
> what would be the best way to achieve this:
>
> a++;
>
> if ( a != 12 && a != 34 && a != 21 && a != 46 && a != 52 ... ) {
> // do something
> }
>
> Am doing my research and trying out some solutions but i thought that
> in the
> meantime someone may have a quick ready answer for this or some good
> hints.
>
> thanks a lot!
>
> Eduardo
> _______________________________________________
> [email protected]
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
--
T. Michael Keesey
Director of Technology
Exopolis, Inc.
2894 Rowena Avenue Ste. B
Los Angeles, California 90039
--
The Dinosauricon: http://dino.lm.com
Parry & Carney: http://parryandcarney.com
ISPN Forum: http://www.phylonames.org/forum/
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com