A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: [F8] Drag two movieclips simultaneously

  1. #1
    Junior Member
    Join Date
    Feb 2007
    Posts
    6

    [F8] Drag two movieclips simultaneously

    Hello ppl!

    First of all, please excuse my double posting I hope someone is gonna be kind enough to help me
    Second, please excuse my english.
    Third, I'm an actionscript n00b, that's why I'm kindly asking you not to laugh when reading my question.

    I intend to create an interactive map of my city. Let's imagine the following scenario:
    1. The movieclip containing the map graphic is scaled at 100%, and it is also centered. However, the size of the scene is much smaller, in both the x and y directions. I created a mask allowing the user to see only the content that's placed between the scene's borders.

    2. Next, I created a pretty small instance of the map graphic, which is located at the upper left corner of the scene, just as a viewport. Over there, I put a semi-transparent square button, having the instance name of port which is draggable over the above-mentioned small map instance.

    Code:
    port.onPress = function() {
    	startDrag("port", true, 21, 13, 108, 171);
    };
    port.onRelease = function() {
    	stopDrag();
    };
    port.onReleaseOutside = function() {
    	stopDrag();
    };
    3. Here comes the cool thing I intend to accomplish (and this is where I got stuck): when dragging the square button over the small map, the big (in fact, 100% scaled) map instance has to move accordingly. For those of you who are using Adobe Photoshop, the behaviour of the "Navigator" palette is quite similar to what I intend to accomplish in Flash I just don't get the idea of how to make the big graphic move the same amount (I mean move the big graphic accordingly to its 100% scaling) as I move the small square button.

    4. Next, I intend to create a set of two zooming buttons (zoom in and zoom out), which can increase and/or decrease the big image's size. The button inside the viewport has to be scaled accordingly, in order to reflect the zone of the image viewed onto the scene.

    But enough with all that clumsy details
    Here's what I discovered after some google-ing: a component especially created for such needs, called Mega Zoom. link here

    So, here are my questions:

    a) How can I make the big image become draggable at the same time the button in the viewport is being dragged?

    b) How can I relate the zooming amount of the button into the viewport to the zooming amount of the main big image?

    any ideas? Please, please help a newbie, any help would be greatly appreciated. I need to finish the project very quickly, as my boss is pressing me to finish the company's website

    help me please.........

    I'm ready to attach the fla in case it would be needed

    thank you all in advance

  2. #2
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    use _x and _y to move the move clips based on the other movie clips _x _y positions.

  3. #3
    Junior Member
    Join Date
    Feb 2007
    Posts
    6
    Thank you calmchess for your advice. But please can you be a little more specific of how exactly I could implement the _x and _y properties? And when I'm saying that I mean making the big image continuously replicate the little square button's movement as long as I am dragging that little square button, i.e. continuous dragging movement. Thank you again

  4. #4
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    well you could use setInterval to constantly check the clips _x and _y but I think i have an example at home that does something similar to what you want without setInterval but you will have to wait untill I get one in 3 hours so I can post it.

  5. #5
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141

  6. #6
    Junior Member
    Join Date
    Feb 2007
    Posts
    6
    Quote Originally Posted by gparis
    thank you oh so much gparis ! Very helpful indeed ! Thank you !!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center