# \_rotation troubles

**URL:** <https://forum.kirupa.com/t/-rotation-troubles/222289>\
**Category:** flash\
**Created:** [April 12, 2007, 9:22am UTC](https://forum.kirupa.com/t/-rotation-troubles/222289 "2007-04-12T09:22:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![superbungalow](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@superbungalow](https://forum.kirupa.com/u/superbungalow)\
**Post date:** [April 12, 2007, 9:22am UTC](https://forum.kirupa.com/t/-rotation-troubles/222289/1 "2007-04-12T09:22:51Z")

</div>

I have a tree movieclip that when clicked, will duplicate itself and the duplicated movieclip will be dragged, using this code:

```auto

onClipEvent (load) {
    var i = 0;
    if (this._name != "tree") {
        startDrag("", true);
    }
}
on (press) {
    if (this._name == "tree") {
        this.duplicateMovieClip("treedup"+i, _root.getNextHighestDepth());
        i++;
    } else {
        startDrag("", true);
    }
}
on (releaseOutside) {
    stopDrag();
}
on (release) {
    stopDrag();
}

```

Then, I want, when the thing is being dragged, for the user to be able to press the left or right button and it rotates. I have used this code:

```auto

onClipEvent (load) {
    var i = 0;
    if (this._name != "tree") {
        startDrag("", true);
        var transformable = true;
    }
}
on (press) {
    if (this._name == "tree") {
        this.duplicateMovieClip("treedup"+i, _root.getNextHighestDepth());
        i++;
    } else {
        startDrag("", true);
        this.transformable = true;
    }
}
on (releaseOutside) {
    stopDrag();
    this.transformable = false;
}
on (release) {
    stopDrag();
    this.transformable = false;
}
onClipEvent (enterFrame) {
    if (Key.isDown(Key.LEFT)) {
        if (transformable == true) {
            this._rotation -= 90;
        }
    }
    if (Key.isDown(Key.RIGHT)) {
        if (transformable == true) {
            this._rotation += 90;
        }
    }
}

```

BUt it only rotates when i am moving the mouse? Can anyone help please?
