This content has been marked as final.
Show 5 replies
-
1. Re: Checking Multiple Similar Or's in an if statement. [AS2]
kglad Aug 16, 2013 10:41 AM (in response to ChristopherDavis)you must do the latter, but if it's worthwhile you can use a for-loop:
var a:Array=[3,74,95,1006];
for(var i:Number=0;i<a.length;i++){
if(jellyfish==a[i]){
//do stuff
break;
}
}
-
2. Re: Checking Multiple Similar Or's in an if statement. [AS2]
Ned Murphy Aug 16, 2013 9:12 AM (in response to ChristopherDavis)The second is the correct way to specify multiple conditions
-
3. Re: Checking Multiple Similar Or's in an if statement. [AS2]
ChristopherDavis Aug 16, 2013 9:15 AM (in response to Ned Murphy)I know it is correct, but I was wondering if there was a simpler way.
Thanks for the help, though.
-
4. Re: Checking Multiple Similar Or's in an if statement. [AS2]
ChristopherDavis Aug 16, 2013 9:34 AM (in response to kglad)Thank you so much!
This is exactly what I needed!You were missing a parenthisis, but besides for that, it works beautifully and looks a lot more visually appealing!
-
5. Re: Checking Multiple Similar Or's in an if statement. [AS2]
kglad Aug 16, 2013 10:41 AM (in response to ChristopherDavis)you're welcome.
(and i corrected that paranthesis in case someone else copies that code.)