# How to shorten IF statement

**URL:** <https://forum.kirupa.com/t/how-to-shorten-if-statement/112793>\
**Category:** Uncategorized\
**Created:** [June 11, 2004, 12:20pm UTC](https://forum.kirupa.com/t/how-to-shorten-if-statement/112793 "2004-06-11T12:20:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![macneilslt](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@macneilslt](https://forum.kirupa.com/u/macneilslt)\
**Post date:** [June 11, 2004, 12:20pm UTC](https://forum.kirupa.com/t/how-to-shorten-if-statement/112793/1 "2004-06-11T12:20:32Z")

</div>

say i have 3 MCs, and i need to check the frames on each one…

```auto

checkFrames = function() {
   if(mc1._currentframe == 1 && mc2._currentframe == 1 && mc3._currentframe == 1) {
            trace("match");
     }
}

```

Is there a more efficient way to write the same IF statement?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 11, 2004, 7:56pm UTC](https://forum.kirupa.com/t/how-to-shorten-if-statement/112793/2 "2004-06-11T19:56:18Z")

</div>

Anytime. 😉
