# Nebody good with If/Then Statements

**URL:** <https://forum.kirupa.com/t/nebody-good-with-if-then-statements/56716>\
**Category:** Uncategorized\
**Created:** [July 7, 2004, 2:35am UTC](https://forum.kirupa.com/t/nebody-good-with-if-then-statements/56716 "2004-07-07T02:35:08Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![BlackFire](https://avatars.discourse-cdn.com/v4/letter/b/a5b964/32.png) [@BlackFire](https://forum.kirupa.com/u/BlackFire)\
**Post date:** [July 7, 2004, 2:35am UTC](https://forum.kirupa.com/t/nebody-good-with-if-then-statements/56716/1 "2004-07-07T02:35:08Z")

</div>

I have a simple If/Then Statement problem. I’m trying to get this button to change it self through an if/then conditional. In addition i’d like the get the button value to remain after the menu is re-minimized (if user clicks button to make it red, then when they re-minimize and then re-maximize it remained red). But i don’t kno where to start there.

i have used the following coding for my button if/then conditional.

```auto
 on (release) {
 
 if (this == "11") {
  //Movieclip GotoAndPlay Behavior
  this.gotoAndPlay("2");
 } else if (this == "6") {
  this.gotoAndPlay("7");
 } else {
  this.gotoAndPlay("7");
  //End Behavior
 }
}
 

```

P.S. I only did one button to learn the concept. So to neone who knows about if/then or boolean conditionals, and can solve this simple issue, please break it down and explain it to me. I wish to learn this concept.

Thanks before hand. :ne:

---

<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:** [July 7, 2004, 2:38am UTC](https://forum.kirupa.com/t/nebody-good-with-if-then-statements/56716/2 "2004-07-07T02:38:51Z")

</div>

Duh!! Seems i forgot the attachment. Sorry! 8-]

---

<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:** [July 7, 2004, 3:11am UTC](https://forum.kirupa.com/t/nebody-good-with-if-then-statements/56716/3 "2004-07-07T03:11:44Z")

</div>

Why are you using _this_ on your if statements?

---

<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:** [July 7, 2004, 4:00am UTC](https://forum.kirupa.com/t/nebody-good-with-if-then-statements/56716/4 "2004-07-07T04:00:30Z")

</div>

when implementing behaviors to the button the _this_ was used to tell flash which frame within which **layer** to play. Shouls i have something else in place of it.

---

<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:** [July 7, 2004, 1:40pm UTC](https://forum.kirupa.com/t/nebody-good-with-if-then-statements/56716/5 "2004-07-07T13:40:59Z")

</div>

The file is empty.  
Are you uusing a movieclip as a button?

---

<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:** [July 8, 2004, 3:04am UTC](https://forum.kirupa.com/t/nebody-good-with-if-then-statements/56716/6 "2004-07-08T03:04:48Z")

</div>

yes… and im sending the file again. must of been a compression glich i guess. Sorry.

P.S. i took out the sound effects so as to make the file size smaller. but u will see blank layers in there place on the menu layout aswell as the button layout. Thus also the spaced out frames.

---

<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:** [July 8, 2004, 9:06pm UTC](https://forum.kirupa.com/t/nebody-good-with-if-then-statements/56716/7 "2004-07-08T21:06:35Z")

</div>

The Buttons are buttons within a movieclip themselves.

---

<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:** [July 9, 2004, 1:24am UTC](https://forum.kirupa.com/t/nebody-good-with-if-then-statements/56716/8 "2004-07-09T01:24:13Z")

</div>

(whistling)

---

<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:** [July 12, 2004, 4:54am UTC](https://forum.kirupa.com/t/nebody-good-with-if-then-statements/56716/9 "2004-07-12T04:54:57Z")

</div>

…

---

<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:** [July 12, 2004, 5:03am UTC](https://forum.kirupa.com/t/nebody-good-with-if-then-statements/56716/10 "2004-07-12T05:03:20Z")

</div>

when you use this as a reference from a button it actually refers to the parent (whether that be the root or another mvoieclip). So you must refer to it using this.button\_instance\_name or simply button\_instance\_name instead.
