Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

as2 game

New Here ,
Feb 18, 2014 Feb 18, 2014

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)

}

TOPICS
ActionScript
475
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Feb 18, 2014 Feb 18, 2014

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.

Translate
LEGEND ,
Feb 18, 2014 Feb 18, 2014

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 18, 2014 Feb 18, 2014

its to keep rotating but only stay on the same frame because all levels are done on one frame per level?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 18, 2014 Feb 18, 2014
LATEST

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 ???

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines