unwanted rotation on the y and z axes

in unity, if I have it in play mode and I change the rotation of the x axis to 180 degrees, for some unknown reason, the y and z axes rotation become 180 also

EulerAngles should be set all at once, not individually. Like this:

var oldRotation : Vector3;

oldRotation = transform.eulerAngles;
transform.eulerAngles = Vector3 (180, oldRotation.y, oldRotation.z);

Also, you know you can’t just set rotation.x, right?