2 Replies Latest reply on May 4, 2006 10:17 PM by pwyon

    Dragging a .swf file on main stage

    dawu
      Okay, I got this action from the tutorial:

      this.createEmptyMovieClip("upcoming1", 1);
      upcoming1.onPress = function() {
      this.startDrag();
      };
      upcoming1.onRelease = function() {
      this.stopDrag();
      };
      stop();

      ---------------------------------------------------------------------------
      With this action, it allows me to drag the Current1 movieclip. In this movieclip, I have a close button and a scrolling bar. After I applied the drag action, it somehow disable all of my click functions on the close button and the scrolling bar.

      I'm using the External Text MX component that I downloaded from the Exchange site.
      I have a mc that contains an external text area with a scroll bar and a close btn.

      Am I missing something? Do I need to create some below the buttons so the buttons will work? Please advise.
        • 1. Re: Dragging a .swf file on main stage
          kglad Adobe Community Professional & MVP
          if you apply mouse handler code to a parent movieclip it will intercept mouse events before any child movieclips can respond.

          to remedy, use a hitTest for the parent or apply mouse handler code on the youngest generation that needs to respond to mouse events.

          p.s. what timeline contains that code and is this.upcoming the name of something other than that empty movieclip? or do you have some other startDrag() statment in your swf?
          • 2. Re: Dragging a .swf file on main stage
            pwyon Level 1
            I posted some code that was like what KGlad said, but it used a Scrollpane instead. Which worked pretty well when I tested it. Scroll, drag, button-- everything worked.

            I'm still trying to find this 'External Text MX" so I can mess around with it.


            ...also, make sure your text isn't "selectable", or funky things may happen. lol
            I tried it.