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

Spinning Wheel

New Here ,
Aug 23, 2013 Aug 23, 2013

hi

i need some help with a spinning wheel i have made.

at the moment when i click spin it spins on to a number eg 1 and then it stops. and i can click spin again and it will go to another number like 2

i would like to know how to make so that whe it lands on any number but in this case 1 it will go to another scene or frame and play.

this is some of the code i have got

if(_level0.turn == 1){

          stop();

}

this code is on all the numbers.

please help

TOPICS
ActionScript
881
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
Participant ,
Aug 23, 2013 Aug 23, 2013

Not sue if I understood your question correctly. try this

if(_level0.turn == 1){

          gotoAndPlay(5); //change this number to the frame number you need to be able to jump.

}

With this you will be able to goto any position wihtin the timeline in the current scene. Also you can try replacing gotoAndPlay with gotoAndStop

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
Engaged ,
Aug 24, 2013 Aug 24, 2013

I also find the question incoherent, however as Ron above says, you could use:

gotoAndStop(5); where you replace 5 with the frame number, obviously ..Stop(5) stops on that frame and ..Play(5) goes to frame 5 and then plays to 6 and so on.

How many numbers are there on the wheel? A more efficient way of writing the code would be to use a loops and use that if statement within it, where the number (e.g. == 1 is the iteration count within that loops, e.g. == iteration), something like this:

var totalNumbers:Number = 16;//change this number to how many numbers there are

for(i=0;i<totalNumbers-1;i++){

     if(_level0.turn == i){

           gotoAndStop(i);

     }

}

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 ,
Aug 24, 2013 Aug 24, 2013

How is the the spinning wheel designed?  Since you the code is on all the numbers it is possible you only need to use gotoAndStop(#), where # is defined by the number of the wheel.  But it all depends on how you designed the wheel.

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
Participant ,
Aug 28, 2013 Aug 28, 2013
LATEST

@rheaninja: make a habbit of marking a thread "CORRECT" or "HELPFUL" if you are happy with an answer...

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