3 Replies Latest reply on May 25, 2007 6:15 AM by Bittasweet

    swapDepths problems

    Bittasweet Level 1
      On my main timeline is a clip 'photobook'
      within one of the frames of photobook, sit two other clips, 'news1' 'news2'
      when either news clip is clicked, a larger version of the image appears, complete with a close button to close the larger image and return to the original. I had some problems with overlapping clips. to remedy this I added this script to the movieclip:

      on (release) {
      this.myButton.gotoAndStop(2);
      this.swapDepths(20000);
      }

      myButton refers to another clip within the news clip which activates the 'larger version.
      I now have no problem with overlapping, BUT
      if i close the original photobook clip (using a close button which returns it to the first, invisible frame of the clip) or navigate to the next frame of photobook, the last news clip clicked on stays on screen, even though it technically only exists in that one frame of photobook.
      I know the problem is with swapDepths, as when deleted, the overlapping returns but not the problem of the clip staying on where it shouldn't!
      this is for my uni project and i am at the end of my tether so please help!!
        • 1. Re: swapDepths problems
          kglad Adobe Community Professional & MVP
          is it the movieclip button whose on(release) you showed the same movieclip that's "existing" in a frame where you don't want it?

          if yes, it exists there whether you use swapDepths() or not. you may not see it on the other frame when you don't use swapDepths() but it's there.

          to remedy, use swapDepths() to move it back to a lower depth where it's not visible when on that other frame.
          • 2. Re: swapDepths problems
            Bittasweet Level 1
            thankyou for the advice, i tried something else tho, changing the depth when i clicked one of the navigation buttons, that seemed to work. but unfortunately i now have another problem!

            in another movieclip on my main timeline "casefile"
            I again have smaller movieclips inside. however, these movieclips have an empty first frame, only 'appearing' by checking for a declared variable which sends it to the second frame. on the second frame, an invisible button allows the user to see a magnified version of the small movieclip by going to the larger version, placed on the third frame. In essence it is an inventory, the objects only appearing when they are 'found' elsewhere in the project.

            Again, I have stacking problems, but this time I am having problems applying the swapDepth script. I can only apply it to the invisible button in the second frame as the movieclip's first frame is empty and not meant to be clicked by the user. i have tried targetting;

            on(release)
            {gotoAndPlay(3);
            _root.casefile.casen1.swapDepths(20000);
            }

            but this doesn't appear to work.
            any thoughts?
            • 3. Re: swapDepths problems
              Bittasweet Level 1
              for main exposure, i'll post this as a new thread as well :d