1 Reply Latest reply on Oct 2, 2013 4:33 AM by Ned Murphy

    Need some help with AS3

    iEpic

      For my school project I have to make a "choose your own adventure" game, and need help with making a back button.

       

      I'm having problems with the previousScene function going to the right previous scene.

       

      For example the scene has 2 options you can choose from, and each option brings you to a new scene.

      If i choose option 2, pressing the back button in that scene doesn't take me to the last scene I was at, it takes me to option 1.

       

      I have many many scenes, and been trying for hours to fix it without having to use gotoAndPlay for each back button.

       

      If anyone could help me it would be greatly appreciated.

       

      Thanks!

        • 1. Re: Need some help with AS3
          Ned Murphy Adobe Community Professional & MVP

          Show the code that is not working.

           

          If you are using the same button for each back button along the timeline layer without having breaks between instances/keyframes, then the button is collecting all of the commands you give it as it moves along and keeps all of them.  You need to either have empty frames between instances or you need to take a different approacvh where instead of assigning new code to the button you reassign the data that code uses,

          1 person found this helpful