var r:Number = (180.0 + this.rotation) % 360.0 - 180.0; r += 360.0 * int(r < 0.0); this.rotation = r;