3 Replies Latest reply on Sep 7, 2006 6:54 PM by Jon_Moyles


      I am designing a fishing game and am having the following problem:

      When the user catches a fish, it goes to a page where they can decide whether or not to keep the fish which is a type of object and is temporarily stored as a variable to access on the frame where you decide to keep it or throw it away. There is a button on this frame called keep and that has the code below. My problem is that when the function is called, it automatically goes to and stops on the first frame of my scene. I can't get it to stay on the same frame as the button.

        • 1. Re: _root.MyFunction(variable);
          Rothrock Level 5
          Wow. I'm not really following it and there is one part that is certainly going to cause you trouble – if not in this exact case then sooner or later.

          First, scenes are a great way of organizing your authortime created timeline animations. But when you start using actionscript to move the playhead around and such you will eventually run into problems. When published to the swf, all scenes are removed and the frames are just run together into one long timeline. This can cause problems and the forums are full of them. Personally I stopped using scenes long ago so I don't really know all the ins and outs, but if you are using actionscript you should probably stop using scenes.

          That being said, I'm not sure how you expect gotoAndStop("return") to leave something on the same frame as the button? Or is some other clip supposed to go to the "return" frame? If so should the code be something like:


          Perhaps I'm just not following it.
          • 2. Re: _root.MyFunction(variable);
            PDMart Level 1
            sorry for the confusing post... i'm not using scenes at all. The fact of the matter is that the gotoAndStop("return"); code doesn't even work. it always goes to frame 1 of the movie. If i take out my function above it, then it works, but with the function there the gotoAndStop command fails to work.
            • 3. Re: _root.MyFunction(variable);
              Jon_Moyles Level 1
              do you have a trace in your keepFish() function? does it work?
              what happens if you put goto above keepFish()?