3 Replies Latest reply on Jun 17, 2010 2:21 PM by kglad

    Moving 2 different movieClips at same time onPress function

    xcmuddman Level 1

      Hello,

       

      Im using the following code to simulate a volume control bar filling on vol+ and unfilling on vol-.

      The dragger is a mask that causes the fill to appear and dissappear when the mouse is pressed and dragged on the volume controller.

       

      It works well, but i would like to add a "switch"  that moves at the same time and in the same location as the fill, but on top of it... I created the movieClip for the switch and tried all kinds of variations to the following code with its instance in the code, but cant seem to get it working... below is the code which works with just the mask filling / unfilling.

       

      Any help would be great!

       

       

       

      this.ratio = 0;
      dragger.onPress = function() {
      this.startDrag(true, 0, 0, line._width, 0);
          this.onEnterFrame = function() {
              ratio = Math.round(this._x*100/line._width);
             _root.volume = ratio;
          };
      };
      dragger.onRelease = dragger.onRelease=stopDrag;

       

       

      Thanks!

       

      Pat