# Help with If statement

**URL:** <https://forum.kirupa.com/t/help-with-if-statement/315737>\
**Category:** flash\
**Created:** [November 3, 2010, 5:51am UTC](https://forum.kirupa.com/t/help-with-if-statement/315737 "2010-11-03T05:51:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![matto333](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@matto333](https://forum.kirupa.com/u/matto333)\
**Post date:** [November 3, 2010, 5:51am UTC](https://forum.kirupa.com/t/help-with-if-statement/315737/1 "2010-11-03T05:51:27Z")

</div>

Hi, I am a complete noob at flash, infact this is my first time ever using it. I am making a game for a school project and need some help with it. What I need to do is set it so when I kill an enemy it sets that it is killed and when I click on the bosses door it checks if I have defeated all the enemies.

What I have so far:  
for enemy:  
on (release) {  
gotoAndStop(6)  
enemy1.killed = true;  
}

When I go to click on bosses door:  
if(enemy1.killed = true)  
{  
gotoAndStop(1);  
}else{  
gotoAndStop(2);  
}

I then got an error telling me that the if statement must appear within an on handler so I put it the on release handler but it went to fram 1 (even though I hadn’t killed the enemy).

Could someone please help me? Could you also please assist me in checking if multiple monsters have been killed (enemy2,enemy3)

Thanks
