# Gesture\_rotate help

**URL:** <https://forum.kirupa.com/t/gesture-rotate-help/332204>\
**Category:** flash\
**Created:** [March 1, 2014, 1:14pm UTC](https://forum.kirupa.com/t/gesture-rotate-help/332204 "2014-03-01T13:14:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chevron8669](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@chevron8669](https://forum.kirupa.com/u/chevron8669)\
**Post date:** [March 1, 2014, 1:14pm UTC](https://forum.kirupa.com/t/gesture-rotate-help/332204/1 "2014-03-01T13:14:19Z")

</div>

Hey guys, I am working on an IOS app and I have a dial on the screen that I want to limit its rotation to 180 degrees in both clockwise and anti clockwise, I have the following code which works for anti clockwise but when i go clockwise you can rotate the dial as much as you want, its not limited to the 180 degrees.

```auto
import flash.ui.Multitouch;
import flash.ui.MultitouchInputMode;
import flash.events.TransformGestureEvent;
import flash.events.GestureEvent;
Multitouch.inputMode = MultitouchInputMode.GESTURE;
Dial_mc.Grip_Bar_mc.addEventListener(TransformGestureEvent.GESTURE_ROTATE, onRotate);
function onRotate(e:TransformGestureEvent):void
{
    Dial_mc.Grip_Bar_mc.rotation += e.rotation;
    if (Dial_mc.Grip_Bar_mc.rotation > 180)
    {
        Dial_mc.Grip_Bar_mc.rotation = 180;
    }
    if (Dial_mc.Grip_Bar_mc.rotation < 0)
    {
        Dial_mc.Grip_Bar_mc.rotation = 0;
    }
}

```

Also on a side note I was wondering if any one could help with how i can trace the rotation so I can make something happen if its going clockwise or anti clockwise like have a text field say which direction the dial is rotating?

Thanks for the help I have been trying to figure this out for a bit.
