10 Replies Latest reply on Sep 3, 2010 10:57 AM by swally1960

    How can I jump from scene to scene without settings being cleared

    swally1960

      I'm making a Jeopardy game. When someone clicks on the button with the dollar amount on it, I have it reset to a different scene on the button so the players know it has been used. When another button is clicked, the first button resets back to its original dollar amount, rather than the blank scene it was reset to.

       

      I'm not sure I'm wording the question very well, but I would appreciate any help you might have for me.

       

      Thanks!

        • 1. Re: How can I jump from scene to scene without settings being cleared
          kglad Adobe Community Professional & MVP

          i think you mean "frame" instead of "scene" and you would use gotoAndStop() to move from frame to frame in your situation.

          • 2. Re: How can I jump from scene to scene without settings being cleared
            swally1960 Level 1

            I'm making a Jeopardy game. When someone clicks on the button with the dollar amount on it, I have it go to a different scene and the button dissapears by using the setProperty(alpha) on the button so the players know it has been used.

             

            The problem is that once they click on the button, for example "100", it goes to another scene that calculates who got it right. Then it goes back to the home screen and the "100" button is gone....which is good, but when i click on another button like "200" then that buttons dissapears but when i go back to the homescreen the "100" button is back again.

             

            Basicaly once i move from scene to scene they reset as i only have 1 frame of stuff on the timeline--so far it "resets" to what i set them to since on the scene where i calculate the score i have a gotoAndStop("Main Screen",1).

             

            So i want to know how to make it where once the button dissapears it updates the first frame every time so it remembers that the button dissapeared and it stays that way.

             

            I'm not sure I'm wording the question very well, but I would appreciate any help you might have for me.

             

            P.S. This is the newly worded part because i had a teacher write it, and he was talking to someone else while he was writing it

             

            Thanks!

            • 3. Re: How can I jump from scene to scene without settings being cleared
              kglad Adobe Community Professional & MVP

              if you need data retained when moving from scene to scene, you must assign variables to store those data.  then you must use the values of those variables to determine the appearance of your buttons.

              • 4. Re: How can I jump from scene to scene without settings being cleared
                swally1960 Level 1

                I did that here like this.

                 

                In each button i have this code on my main screen i have this

                 

                on(release) {

                     indexscore = 100; (is the point value)

                     cellnumber = 1; (i made the instance of each button "Cell" and then a number incrimenting....Cell1, Cell2.....

                     gotoAndStop("Questions", 1);

                }

                 

                Once it goes to the Questions scene that is where i click a button that will add the index number to my total points depending on if they clicked the button for team 1 or team 2... then that goes to my Answer scene which shows the right answers.....

                 

                This is the button that goes to the main screen from the answer scene

                 

                on(release) {

                     gotoAndStop("Main Screen", 1);

                     blankcell = "Cell"+cellnumber;

                     setProperty(this.blankcell, _alpha, false);

                }

                 

                i have blankcell declared at the beginning of the game as a global var

                 

                this code works so far but atm as soon as i try to have more than one button disapear it doesnt work, the problem i see is that im telling it to go back to that scene at frame 1, and that has all the buttons appear.....in other words it will make one disapear because its the button right before it but the frame with all the cells will override as soon as i try to get another button to dissapear.

                • 5. Re: How can I jump from scene to scene without settings being cleared
                  kglad Adobe Community Professional & MVP

                  each button will probably need to use a different variable.

                  • 6. Re: How can I jump from scene to scene without settings being cleared
                    swally1960 Level 1

                    if i use a different variable for each one then im going to have 56 different variables 56 different declarations that sets the property of the buttons. is there a way to post my file and you could take a look at it?

                    • 7. Re: How can I jump from scene to scene without settings being cleared
                      kglad Adobe Community Professional & MVP

                      i don't download and correct files unless i'm hired.

                       

                      but i can tell you, from what i see in this forum, that your setup isn't good.  one, you're using scenes (which are helpful for designers) but are avoided by all developers because if you mix actionscript and scenes, you can expect problems.  and two, you have code attached to objects and that's a good way to cause problems.

                       

                      i don't know any simple way for you to correct what you've started.  but, if you're not too far into this project, you would be better served to start over, not use scenes and attach no code to objects.

                      • 8. Re: How can I jump from scene to scene without settings being cleared
                        swally1960 Level 1

                        might css help me with the problem?

                        • 9. Re: How can I jump from scene to scene without settings being cleared
                          kglad Adobe Community Professional & MVP

                          css is used to format html enabled textfields.  i don't see that as helping you.

                           

                          i would use movieclip buttons and assign a property to each button that contained the needed data.

                          • 10. Re: How can I jump from scene to scene without settings being cleared
                            swally1960 Level 1

                            i tried using no scenes and movie clips by putting an invisible button in front of the movie clip and make that dissapear, but that still did not work at all. so far i dont think anything is going to work unless i can make it to where it automatically updates the first frame which i still dont know how to do..... : (