# Simple question (probably)

**URL:** <https://forum.kirupa.com/t/simple-question-probably/1054>\
**Category:** Uncategorized\
**Created:** [August 7, 2002, 1:32pm UTC](https://forum.kirupa.com/t/simple-question-probably/1054 "2002-08-07T13:32:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zerium](https://avatars.discourse-cdn.com/v4/letter/z/85e7bf/32.png) [@zerium](https://forum.kirupa.com/u/zerium)\
**Post date:** [August 7, 2002, 1:32pm UTC](https://forum.kirupa.com/t/simple-question-probably/1054/1 "2002-08-07T13:32:30Z")

</div>

I just have one quick question. As I have been going through the new flash mx book advanced actionscript from the source I have noticed instances where instead of using the regular “=” sign they use the “==” sign but, they negate mentioning why or when to use each particular instance. (example below)

Can someone elaborate on this?

thanks ahead of time!

-z

ex:

MovieClip.prototype.flip = function(mode){  
&nbsp;&nbsp;&nbsp;if (mode.toLowerCase() == “h”){  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.\_xscale = -this.\_xscale;  
&nbsp;&nbsp;&nbsp;}else if (mode.toLowerCase() == “v”){  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.\_yscale = -this.\_yscale;  
&nbsp;&nbsp;&nbsp;}  
}

---

<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:** [August 7, 2002, 1:39pm UTC](https://forum.kirupa.com/t/simple-question-probably/1054/2 "2002-08-07T13:39:47Z")

</div>

that is a good question with a simple answer.

= assigns value to something. For example age=23. If you Trace(age);  
The result would be 23.

== compares values (as in Boolean operation) and returns True or false. If you trace(age==23); It would return true or flase, depending on the value of age.

so… in my code I have

Guess someones age.

var age=23; //asigns 23 to age

if(age==23){  
trace(“you guessed it!”);  
} else{  
trace(“try again!”);  
}

hope that helps

---

<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:** [August 7, 2002, 1:47pm UTC](https://forum.kirupa.com/t/simple-question-probably/1054/3 "2002-08-07T13:47:27Z")

</div>

thanks,

I knew there was a “good” reason 🙂

Odd it wasn’t explained in the book, guess it was implied. Anyway thanks again.

-z

I said that the operator == had not been explained in the book but, actually it is explained along with the other operators used in conditional logic. Its just later in the book. I guess they figured it wasn’t necessary to know until half-way through.

anyway just thought I’d give the authors credit.
