Copy link to clipboard
Copied
hi im making a simple maze game and i am new to flash and am hoping to be able to find a code to make a movie clip or button rotate continously but when rolled over by mouse cursor go to a set frame?
the code i use for making the rollover and change frame is
on (rollOver) {
gotoandplay(set frame)
}
How do you intend to have the raotation done? How does the rotation relate to the going to a frame, if at all... they do not necessarily affect each other based on anything you have described.
To make something rotate you can continuously increment its _rotation property.
If the intention is to stop at the frame for the rollover, then you probably want to use gotoAndStop rather than gotoAndPlay.
Copy link to clipboard
Copied
How do you intend to have the raotation done? How does the rotation relate to the going to a frame, if at all... they do not necessarily affect each other based on anything you have described.
To make something rotate you can continuously increment its _rotation property.
If the intention is to stop at the frame for the rollover, then you probably want to use gotoAndStop rather than gotoAndPlay.
Copy link to clipboard
Copied
its to keep rotating but only stay on the same frame because all levels are done on one frame per level?
Copy link to clipboard
Copied
You should change the way you are coding so that you do not have code place "on" objects, but instead have it all in the timeline where it is easier to manage.
Assign an instance name to the object that you want to have rotating. Let's say you name it "rotatingMC"
Then in the timeline use the following code to make it rotate constantly....
rotatingMC.onEnterFrame = function(){
rotatingMC._rotation += 1; // a higher value makes it go faster
}
and to make a rollover for that same object you can use...
rotatingMC.onRollover = function(){
gotoAndStop(???); // assign something in place of ???
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now