1 Reply Latest reply on May 21, 2006 7:34 PM by Newsgroup_User

    Problem with accessing a button that is inside an attached movie clip

    Lifeasalounge Level 1
      I have a button which is inside a movie clip. This movie clip is attached when the movie is loaded. I have a function that looks like this:

      obj3.onPress = function () {
      startDrag(this);
      this.swapDepths(this._parent.getNextHighestDepth());
      };

      This function controls the actions taken when a user clicks on the movie clip. The button that is inside the movie clip has an onPress handler assigned to it also, but when i click the button nothing happens.

      Can someone please help?
        • 1. Re: Problem with accessing a button that is inside an attached movie clip
          Level 7
          "Lifeasalounge" <webforumsuser@macromedia.com> wrote in message news:e4r3s4$28t$1@forums.macromedia.com...
          >I have a button which is inside a movie clip. This movie clip is attached when
          > the movie is loaded. I have a function that looks like this:
          >
          > obj3.onPress = function () {
          > startDrag(this);
          > this.swapDepths(this._parent.getNextHighestDepth());
          > };
          >
          > This function controls the actions taken when a user clicks on the movie clip.
          > The button that is inside the movie clip has an onPress handler assigned to it
          > also, but when i click the button nothing happens.
          >
          > Can someone please help?

          Dragging movieclips with buttons in them.. buttons not working.. it's a very old and well known question.. it's been coming up for
          years on the forums. You can do a search of the forums and look at some solutions. Short answer.. don't stack onPress event
          handlers. Use a hitTest (in a loop) for the movieclip and drag so that the onPress events of the buttons will still work. If you
          need code, just put these words in the search... drag movieclip buttons "not working"
          tralfaz