3 Replies Latest reply on Oct 19, 2010 9:04 AM by kglad

    help setting multiple depths correctly on movie clips

    ElrocoOne

      I have a splash page for a site I have built and it is 7 hexagons in a group like part of a bee hive.

       

      When I mouse over on it grows (tweens) and will ultimatley show some content when finally completed.

      on mouse out it shrinks back to normal size.

       

      what I want to achieve is that when mouse over the depth of that mc instance is on top and all the others a in the background.

       

      now for that part I can't seem to get right...

       

      if I have mouse out from another of the 7 clips to mouse over another I want the mouse over tween of the new hex square to be on top and the mouse out tween of the prevous hex square to be below the new mc Instance that I have just mouse over and all the rest of the hex squares to be at a depth below the the hex square I have just mouse out from...

       

      I really hope that makes sense...

       

      This is the code I have on the buttons

       

      on (press, rollOver, dragOver) {


      this.swapDepths(100); // set this instance to top depth
      _root.x.swapDepths(50); // set mouse out instance below top


      for (var i in _root.mcArray) {  // remove last mc over from array
        if(_root.mcArray[i] == _root.x){  
         _root.mcArray.splice(i, 1)  
        }  
      }


      for (var s in _root.mcArray) {  // set depth on all other mc's below mouse out mc's depth
        _root.mcArray[s].swapDepths(1);
      }


      gotoAndPlay("s1"); // grow hex


      }


      on (rollOut, dragOut) {
      _root.mcArray = new Array("btn_fixedlines","btn_bundles","btn_mobiles","btn_sfoa","btn_adsl","btn_customercar e","btn_myaccount"); // reset array of button names
      _root.x = 'btn_myaccount'; // set last button name that was mouse overed - this is the name of the mc instance and is different on each button
      gotoAndPlay("s2"); // shrink hex
      }

       

      lastly i have set the following array in frame one of the main time line.

       

      var mcArray = new Array("btn_fixedlines","btn_bundles","btn_mobiles","btn_sfoa","btn_adsl","btn_customercar e","btn_myaccount");

       

      please help I have spent the last 2 days trying to get this just right...

       

      Message was edited by: ElrocoOne