Code:
buttonInstance.onPress = function() {
this.onEnterFrame = rotClockwise();
// the above line will not work if () is removed
}
buttonInstance.onRelease = function() {
this.onEnterFrame = null;
}
function rotClockwise() {
protactor._rotation += 1;
}
If you remove the () on line 2, the script DOES NOT WORK. I don't know why you're giving me such an attitude on this. I placed the code in Flash MX, TESTED IT, and if you leave () off, the pressing of button named buttonInstance does NOT rotate the MC named protactor. If it is added, then clicking the button DOES rotate the MC.
Bookmarks