4 Replies Latest reply on May 3, 2006 8:25 PM by dawu

    Applying an onDrag actionscript to a loaded swf

    dawu Level 1
      I want to make a loaded swf file dragable within the main stage. Can someone point me to a tutorial or show me how to do it?

      Thank you!
        • 1. Re: Applying an onDrag actionscript to a loaded swf
          dawu Level 1
          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.

          Am I missing something? Do I need to create some below the buttons so the buttons will work? Please advise.

          Thank you!
          • 2. Re: Applying an onDrag actionscript to a loaded swf
            pwyon Level 1
            This one took a few tries to get right. But I think I figured it out for yuh'. I assumed you were using a "ScrollPane" for your scrolling and that there was a button inside of that component. Let me know if this is wrong. It shouldn't be too different even if you're not using the "ScrollPane". Aslo, all the code below goes on the main timeline.

            notes:
            "container" is the empty clip that holds the content.

            "mc" is the MovieClip inside of the ScrollPane ( located in the loaded *.swf ).

            "mouseIsDown" is a boolean ( true/false). It checks to see if the user is holding down on the mouse or not.

            The rest is pretty easy to figure out.

            ---------------------------------------------------


            • 3. Applying an onDrag actionscript to a loaded swf
              dawu Level 1
              pwyon,

              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.
              • 4. Re: Applying an onDrag actionscript to a loaded swf
                dawu Level 1
                I have a mc that contains an external text area with a scroll bar and a close btn.