2 Replies Latest reply on Feb 29, 2008 1:38 PM by PremierPTS

    gotoAndStop help

    PremierPTS
      Good afternoon people. I'm teaching myself flash and an having difficulty in getting the gotoAndStop feature working correctly and I'm asking for your help in understanding it. I have a site that has flash at the top that plays it's frames in the main index.html. On subsequent pages which are selectable from the main flash, I'd like to open the subsequent page and gotoandstop ad a particular frame. What happens now is the whole animation plays in it's entirety on the subsequent pages. Basically the flash is a description of areas on the site.

      The flash displays pictures and text for say sectionA sectionB & sectionC with a replay button at the end. I have corresponding buttons for those sections in the flash that are selectable. When I select sectionA, the page for sectionA loads fine but the whole animation plays again. What I'd like is for the sectionA page to load and only display the frame that corresponds to sectionA in the flash. Here is where I think the relevant instructions go, but for the life of me I can't get it.


      Any assistance would be greatly appreciated and thanks.
        • 1. Re: gotoAndStop help
          sneakyimp Level 2
          I'm not certain but I think your problem is the preloader which is always calling gotoAndPlay(2). Try changing it to this?

          var allLoaded=false;

          onClipEvent (enterFrame) {
          if (allLoaded) return;
          loaded = _root.getBytesLoaded();
          percent = int(loaded/total*100);
          text = percent+"%";
          gotoAndStop(percent);
          if (loaded == total) {
          allLoaded = true;
          _root.gotoAndPlay(2);
          }


          A better approach would be to delete the onEnterFrame function but I'm not sure quite how to do that.
          • 2. Re: gotoAndStop help
            PremierPTS Level 1
            Thanks Sneakyimp, I'll give that a try...