# If

**URL:** <https://forum.kirupa.com/t/if/20196>\
**Category:** flash\
**Created:** [May 6, 2003, 11:15am UTC](https://forum.kirupa.com/t/if/20196 "2003-05-06T11:15:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Idan](https://avatars.discourse-cdn.com/v4/letter/i/91b2a8/32.png) [@Idan](https://forum.kirupa.com/u/Idan)\
**Post date:** [May 6, 2003, 11:15am UTC](https://forum.kirupa.com/t/if/20196/1 "2003-05-06T11:15:53Z")

</div>

I wonder to know How to write simple if sentence

so,  
If I write

onClipEvent (load) {  
speed = 1;  
a=this.\_x;  
}  
onClipEvent (enterFrame) {  
this.\_x += speed;  
}

Now I want to write

If this.\_x = 32 then This.\_rotation=180

How I added this in the right way?

please replay.  
thanks! :pope:

---

<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:** [May 6, 2003, 11:44am UTC](https://forum.kirupa.com/t/if/20196/2 "2003-05-06T11:44:58Z")

</div>

if(this.\_x == 32) {  
this.\_rotation = 180  
}

notice that in the if condition there is “==” NOT “=”  
== checks a value of something but = assigns a value to something!  
oh and it might be better to do like this:

if(this.\_x **\>=** 32) {  
this.\_rotation = 180  
}

this checks if the \_x is bigger than (or equal to) 32 cuz maybe the movieclip won’t land on exactly 32! It may be  
31.0002 then 32.20025 and then 33.3003 etc! so then that wouldn’t work!  
I think it’s better to use the the last one!

---

<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:** [May 6, 2003, 12:14pm UTC](https://forum.kirupa.com/t/if/20196/3 "2003-05-06T12:14:53Z")

</div>

thanks!
