# OR operator, using correctly?

**URL:** https://forum.kirupa.com/t/or-operator-using-correctly/76351
**Category:** flash
**Created:** [January 18, 2005, 12:22am UTC](https://forum.kirupa.com/t/or-operator-using-correctly/76351 "2005-01-18T00:22:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bisket](https://avatars.discourse-cdn.com/v4/letter/b/87869e/32.png) [@bisket](https://forum.kirupa.com/u/bisket)
#### Post date: [January 18, 2005, 12:22am UTC](https://forum.kirupa.com/t/or-operator-using-correctly/76351/1 "2005-01-18T00:22:36Z")

</div>

why doesn’t this work?

```auto
 
if (_root.currentSection == "Comgroup" || "Clientrooms" || "Contact") {
 _root.sectionsBG("out");
} else if (_root.currentSection == "Work" || "Us" || "News" || "Insights" || "Opportunities") {
 trace ("Background is in place.");
}

```

basically in english, i’m trying to say that:

if color is equal to purple or orange or brown then do this, else if color is equal to red or pink or green, then do this.

the error the above code is having is that, no matter what \_root.currentSection is, it always goes to the first if statment, so leads me to believe i’m using the || operator wrong.

thanks.
