3 Replies Latest reply on Feb 1, 2007 2:58 PM by depakchopra

    swapDepth question

    depakchopra
      I have a grid that is being generated dynamically. Each square in the grid is a movieclip button square. When you rollover the mc-btn square you activate a large movieclip. Currently, the movieclip is behind the grid created by the dozens of other squares generated at higher levels.

      What I would like to do is pull the movieclip forward on rollover to say level 1000 (above everything else) and on rollout, bring it backdown to its original level.

      I've used swapDepth before, but for somereason, it is eluding me now. I left out all the different ways I have tried to swapDepth so that it is not overly confusing.
        • 1. Re: swapDepth question
          Stargazer712
          Hmm...what you might want to look into is doing two things to get this to work:

          1) After you've initialized the grid, create the large movie clip, and use the getNextHighestDepth() function.

          2) Immediately after you make it, make the _visible property false. Whenever you want it to "come to the top," simply make _visible = true;

          The way that you were trying to do it with swap depth may work, but I'm not sure I see much benefit to doing that. Perhaps look at this way, and if it won't fit your needs, go ahead and say so.
          • 2. Re: swapDepth question
            depakchopra Level 1
            Thanks for replying. I have to say that I am of no great shakes when it comes to actionscript. I have tried using the 'getNextHighestDepth' several ways. Maybe I have just been putting it in wrong.

            I will try your visible =true idea and I was just thinking after reading your post that I might create two grids. One below that would be the outlines and one above that would activate as you rolled your mouse over it.

            I would find it helpful if you had a code example for the getNextHighestDepth() if you think it would work.

            Thanks again for your reply
            • 3. Re: swapDepth question
              depakchopra Level 1
              I just wanted to say that I solved this problem. i might not have done it in a sexy manner. but for future reference, what I did was use the flash form application.

              I put the photo and a static dynamically created grid on the bottom layer using two new instance names and mc's. These new items are the same as what was in the first code, but with a 2 at the end of them. I also took the over and out states from the code.

              Then I pretty much just re-did what I have in the first code above without a picture behind it and now everything works out fine.

              I could not get the swapDepth or NextHighestDepth to work on this problem.

              Thanks for your help though StarGazer.