6 Replies Latest reply on Aug 23, 2007 11:38 AM by greggyd

    startDrag Questions

      Hey party people.

      I'm working on a project that involves interactive maps. The idea is to have a single flash file that opens with a map of a city. Within this city map there are invisible buttons on certain areas that, when clicked on, show a more detailed map of that specific area. Within this area map, there will be buttons that show information about landmarks, restaurants, etc..

      One problem that I'm running into is when I apply a startDrag to the city map(its a big map) so people can drag around to the different areas, it also drags the other maps as well. You drag the city map to the left, click on an area and the area map has been moved to the left. I've tried building this in multiple key frames, multiple layers and multiple scenes; each time the results are the same.

      Any insight on this would be greatly appreciated. Thanks.
        • 1. Re: startDrag Questions
          clbeech Level 3
          put everything into one MC, layer that mc, 'areas' and 'details' on top, 'big map' on the bottom. when you're not over an 'area' or 'detail' you will be in contact with the 'big map' handlers, in the on(press) handler for the 'big map' refer to the _parent to drag everything at once:

          on(press) {

          same with the on(release) handler, stop the drag by refering to _parent.
          • 2. Re: startDrag Questions
            Level 7
            >>stop the drag by refering to _parent.

            You can just say stopDrag(); - you don't need to refer to anything.

            Dave -
            Head Developer
            Adobe Community Expert

            • 3. Re: startDrag Questions
              Damon Edwards Level 3
              on(press) {

              startDrag requires at least 1 parameter. why don't you specify the target... if your big map has an instance name use startDrag(bigMap); if your smaller maps are not in the bigMap movie clip, they shouldn't drag
              • 4. Re: startDrag Questions
                clbeech Level 3
                True, the startDrag() 'function' , I was just using the MovieClip.startDrag() 'method'. I agree the function with a target parameter would be fine, but he'll still need to refer to the parent clip, if he puts everything into one clip, because he wants to move it all together at one time...

                ...wait a minute, he's saying he DOESN'T want the others to move?? OK I misunderstood ... I don't really understand that, but ... use dz's method.

                stopDrag() ... yes true, but the docs say either syntax is fine, method or function.
                • 5. Re: startDrag Questions
                  greggyd Level 1
                  Thanks for the responses, you guys are quick.

                  If I make the large city map a MC and specify it in the startDrag() function then my invisible buttons stay in place. When you drag the map to the left to click on the area, the button stays where it was. It doesn't follow the map.

                  I know you guys might frown upon this but if I make the large city map a button then when I write startDrag(this); everything stays together when I drag it. But then I still have the problem of the other maps in other scenes moving.
                  • 6. Re: startDrag Questions
                    greggyd Level 1
                    I've made each map a MC. then I put each MC into it's own scene. I used the _parent on each MC, but the MCs in the other scenes are still being moved.
                    Am I missing something?