If

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:

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!

thanks!