# Flash CS4 (IF statements)

**URL:** <https://forum.kirupa.com/t/flash-cs4-if-statements/277968>\
**Category:** flash\
**Created:** [December 19, 2008, 1:12pm UTC](https://forum.kirupa.com/t/flash-cs4-if-statements/277968 "2008-12-19T13:12:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JacqueDoctrique](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@JacqueDoctrique](https://forum.kirupa.com/u/JacqueDoctrique)\
**Post date:** [December 19, 2008, 1:12pm UTC](https://forum.kirupa.com/t/flash-cs4-if-statements/277968/1 "2008-12-19T13:12:46Z")

</div>

Hello friends, i have recently tried to make an escape room game following a tutorial. I am almost finished however there is one thing that has stopped me from finishing it. This game is just a basic test as its my first game of any type. So to win the game you supposedly have to collect three items, which are two key pieces and a ring. You can combine the key pieces to make a key. However at the end, when you put the key to the door it ends the game. I dont know how to make it end only if both statements are true, which is you have the key AND the ring. This is my actionscript code.

```auto
onClipEvent(enterFrame)
{
if(_root.inv1_mc.inv_key3.hitTest(this._parent.door_trigger))
gotoAndPlay ("door_open");
}

```

After the if\_root.blablabla i aslo want to add another code which says AND if ringlocated=“true”

So i actually want my code to be

```auto
  onClipEvent(enterFrame)
{
if(_root.inv1_mc.inv_key3.hitTest(this._parent.door_trigger)) AND if(ringlocated=true)
gotoAndPlay ("door_open");
}

```

So how do i connect these statements ?
