2 Replies Latest reply on Dec 10, 2009 5:01 AM by pggolden

    Dragging the stage newbie question part 2


      Hi guys. I posted a thread on 16th November http://forums.adobe.com/thread/525138 and have created an animation (see attached) where the stage can be dragged from left to right to reveal hidden areas off the edge of the stage. Unfortunately I need to add buttons containing links to websites within the dragable movie symbol and I can't work out how to do it. Any ideas?

        • 1. Re: Dragging the stage newbie question part 2
          RossRitchey Level 4

          Stealing the code from the old thread, for ease-of-use, here is what you will need to do.  Like the alert button that tells people what to do, you need to add the other links/buttons separately from the draggable clip, and move them with it.  This is fairly simple to do.



          mc_portletlist.onPress = function()
               btn_popup._visible = false;
          btn_popup.onPress = function()
               btn_popup._visible = false;
          mc_portletlist.onMouseDown = function() {
               mc_portletlist.onEnterFrame = function(){
                    buttonToMove._x = mc_portletlist._x;
                    buttonToMove._y = mc_portletlist._y;
          mc_portletlist.onMouseUp = function() {
               mc_portletlist.onEnterFrame = null;



          You will need to play with this a bit, as you want the buttonToMove to move with the draggable clip, you will need to add/subtract from the mc_portletlist x and y as appropriate.  If you want to have multiple items, I would place them all in a MovieClip, make sure its on a layer above mc_portletlist, and have that one item move.


          See the attached zip for a working example SWF and Flash CS3 FLA

          1 person found this helpful
          • 2. Re: Dragging the stage newbie question part 2
            pggolden Level 1

            Cheers. I'll have a go at that.