# Change rotate center object AS to counterclockwise

**URL:** <https://forum.kirupa.com/t/change-rotate-center-object-as-to-counterclockwise/312941>\
**Category:** flash\
**Created:** [August 16, 2010, 3:15pm UTC](https://forum.kirupa.com/t/change-rotate-center-object-as-to-counterclockwise/312941 "2010-08-16T15:15:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![somnamblst](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@somnamblst](https://forum.kirupa.com/u/somnamblst)\
**Post date:** [August 16, 2010, 3:15pm UTC](https://forum.kirupa.com/t/change-rotate-center-object-as-to-counterclockwise/312941/1 "2010-08-16T15:15:49Z")

</div>

I’m not the swiftest when it comes to math, but usually I can figure out through trial & error how to modify AS. For the life of me I can not figure out where this AS gets it clockwise rotation, so that I can change it to counterclockwise.

```auto
onClipEvent(load){
    this.rotation_speed = 2;
    
    function origin(){
        var bounds = this.getBounds(this._parent);
        return {x:(bounds.xMin+bounds.xMax)/2, y:(bounds.yMin+bounds.yMax)/2};
    }
    this.rotation_origin = origin();
}
onClipEvent(enterFrame){
    this._rotation += rotation_speed;
    var curr_origin = origin();
    this._x += this.rotation_origin.x - curr_origin.x;
    this._y += this.rotation_origin.y - curr_origin.y;
}

```
