2 Replies Latest reply on Apr 2, 2008 12:06 PM by UnholyJesus

    swapDepths confusion

    teemflmngo Level 1
      Could someone tell me why the first bit of sample code works and the second does not?

      Ultimately, I would like to click on a movieclip and bring it to the highest depth. I was thinking that I needed to create a new empty movie clip at the next highest depth, and then swap it with my intended clip -- although I'm open to any better suggestions
        • 1. Re: swapDepths confusion
          rlc5611 Level 1
          First add one trace to your function like this:

          first_mc.onPress = function () {
          _parent.createEmptyMovieClip ("emptyClip"+d, _parent.getNextHighestDepth());
          _global.empty_mc = "emptyClip"+d;

          see what you get.

          Now try it this way:

          first_mc.onPress = function () {
          this._parent.createEmptyMovieClip ("emptyClip"+d, this._parent.getNextHighestDepth());
          _global.empty_mc = "emptyClip"+d;

          and see what you get.
          • 2. swapDepths confusion
            i think you're taking the hard way ... (but maybe i'm wrong...)
            you whant to get your clip on highest level when you click on it, right ?

            so why not use :