4 Replies Latest reply on May 15, 2009 8:42 AM by GellyBean

    SWAP IMAGES...

    GellyBean

      Hi all,


      I have 3 images...

      I created 3 movie clips for each one (a_mc, b_mc, c_mc). It shows up as one behind the other, but what I want is to: click on the  movie clip that is shown as the last one (or the second one) and have it appear at the front (a swap with the first) with a nice transition.
       
      Thank you all.

       

      swapimages.jpg

       

      Kglad answer:

       

      var mcA:Array=[a_mc,b_mc,c_mc];

      for(var i:uint=0;i<mcA.length;i++){

      mcA[i].addEventListener(MouseEvent.CLICK,f);

      }

      function f(e:Event){

      setChildIndex(e.currentTarget,numChildren-1);

      }

       

      // and you'll need to create your transition.

       

      My Reply

       

      Hi, Kglad...

       

      thank you for you Help. I think that I should not have post it this under AS3... because the answer to my question  actually is:

      swapDepths

       

      on (press, dragOver) {
          startDrag(_root.c_mc);
      }
      on (release, rollOut, dragOut) {
          stopDrag();
      }
      on (press, release, dragOver, dragOut) {
          _root.x +=2;
          _root.c_mc.swapDepths(_root.x);
      }

      I'm still looking for the way to do it with a transition or effect.

       

      (The effect I want is to see the transition from behind to front....)