# If/ else statements

**URL:** <https://forum.kirupa.com/t/if-else-statements/3599>\
**Category:** Uncategorized\
**Created:** [January 18, 2002, 3:23pm UTC](https://forum.kirupa.com/t/if-else-statements/3599 "2002-01-18T15:23:27Z")\
**Posts on this page:** 4\
**Page:** 1

<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:** [January 18, 2002, 3:23pm UTC](https://forum.kirupa.com/t/if-else-statements/3599/1 "2002-01-18T15:23:27Z")

</div>

I require one action to be definately executed on one target movieclip.

Then I need to check 5 other movieclips to see if they are on a certain frame, and if so then to instruct them to play.

I understand that I need to use if / else statements and \_currentframe property for the second part…but I can’t get both parts of the code to execute. Only one or the other…Is there and and statement or something of the like…

---

<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:** [January 18, 2002, 4:24pm UTC](https://forum.kirupa.com/t/if-else-statements/3599/2 "2002-01-18T16:24:41Z")

</div>

Yes, you can use that, doing so :  
if ((movie1.\_currentframe == 20) and (movie2.\_currrentframe ==20) and …) {  
play () ;  
}

You can also set a variable “i” to 0 in your main timeline. When your first MC gets to the frame you want, do \_root.i += 1 ;

Then you can test if (\_root.i ==5) {play();}

Should work.

pom

---

<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:** [January 19, 2002, 5:37am UTC](https://forum.kirupa.com/t/if-else-statements/3599/3 "2002-01-19T05:37:56Z")

</div>

though if you are working in Flash 5.0 you should use the “&&” instead of “and”.

---

<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:** [January 19, 2002, 9:58am UTC](https://forum.kirupa.com/t/if-else-statements/3599/4 "2002-01-19T09:58:26Z")

</div>

[pub40.ezboard.com/fkirupa…6.topic…](http://pub40.ezboard.com/fkirupafrm8.showMessage?topicID=2136.topic...)

kinda simular to what yuo want … i think…

ZH…
