I have a tree movieclip that when clicked, will duplicate itself and the duplicated movieclip will be dragged, using this code:
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:
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?