4 Replies Latest reply on May 13, 2006 12:08 AM by mr. figgles

    Sounds like a no brainer...

    mr. figgles
      So I have developed several stand alone flash games and I am not a newbie. My question is does anyone know exactly how gotoAndStop(); works?

      What I mean is, does the playhead litereally "skip" to the specified frame _root.gotoAndStop(200); or does it stop and chat with other frames along the way?

      The reason I ask is I have a game here with 100 levels and the first 30 or so levels load pretty quick from my level select screen, however, each level there after starts to take longer and longer to load. By the time you are trying to press the level 100 button the game literally takes 30 seconds to load.

      I must add, this game isn't played in a browser, so Im not worried about the bandwidth issues. Any help or insight would be great. thanks!
        • 1. Re: Sounds like a no brainer...
          Level 7
          mr. figgles,

          > My question is does anyone know exactly how gotoAndStop();
          > works? What I mean is, does the playhead litereally "skip" to
          > the specified frame _root.gotoAndStop(200); or does it stop and
          > chat with other frames along the way?

          There's a difference between the global gotoAndStop() function and the
          MovieClip.gotoAndStop() method, but neither of those "chats" with other
          frames; both send the playhead directly to the specified frame (or frame
          label) of a given timeline.


          David
          stiller (at) quip (dot) net
          Dev essays: http://www.quip.net/blog/
          "Luck is the residue of good design."


          • 2. Re: Sounds like a no brainer...
            Varun.S.Nair
            Dont worry.Gotoandstop will make it jump to the particular frame.Can you please tell me whether these levels are placed in different frames or different swf.My assumption is frames.If the frame is very heavy,it will sometimes cause problems no matter the concept is jumping to the particular frame.Please consider that one also !
            • 3. Re: Sounds like a no brainer...
              mr. figgles Level 1
              Thank you for your replies My levels are on frames and each level has exactly the same amount of data. Meaning level 1 is no "heavier" than level 97. My gotoAndStop(20) works great, but my gotoAndStop(160) is dog slow. I am not doing anything different (that I can see) between the two.

              I will keep investigating and post my findings if they are relevant thanks again

              • 4. Re: Sounds like a no brainer...
                mr. figgles Level 1
                So after retracing my steps I seem to have at least identified one of the culprits....

                It seems to be that "convert to frame" was the evil gear in the mechanism.

                Originally I had 10 level set keyframes, evenly spaced with different level "pieces" on each. Then I "converted to keyframe" the 10 frames in between the levelset keyframes. This way I could delete and arange the pieces per level as per my discression.

                This is bad. In not very technical terms my load times got progressively worse on each level. Im not sure exactly how convert to key frames works but the solution it turns out is to use "insert keyframe".

                I believe it has something to do with instancing and how many objects are present during the conversion process, but none the less, a painfully undocumented bug that hopefully may help anyone else who runs across it.

                Thanks again for your replies and insights