Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0

Reply
 
Thread Tools Rate Thread Display Modes
Old 12-02-2005, 11:33 AM   #1
charlie83
Registered User
 
Join Date: Oct 2005
Posts: 35
Default Using startDrag() to drag multiple MovieClips

Hello,

I have this code:

Code:
mc1.startDrag();	
mc2.startDrag();
but only mc2 drags, not mc1. How do I make both MovieClips drag?
charlie83 is offline   Reply With Quote
Old 12-02-2005, 11:43 AM   #2
FormerSwinger
CurrentFlasher
 
FormerSwinger's Avatar
 
Join Date: May 2005
Location: Finland
Posts: 382
Default

You could place them inside a third movieclip and drag that.
You can also make the first mc to follow the second one instead of following the mouse.
FormerSwinger is offline   Reply With Quote
Old 12-02-2005, 12:40 PM   #3
charlie83
Registered User
 
Join Date: Oct 2005
Posts: 35
Default

How do i make the second movie clip follow?
charlie83 is offline   Reply With Quote
Old 12-02-2005, 01:08 PM   #4
senocular
six eyes
 
senocular's Avatar
 
Join Date: Jan 2003
Location: San Francisco, CA (USA)
Posts: 7,875
Send a message via ICQ to senocular Send a message via AIM to senocular Send a message via MSN to senocular Send a message via Yahoo to senocular
Default

use onMouseMove and just set the position of the movie clip to the location of the mouse
__________________
(6)
senocular is offline   Reply With Quote
Old 05-28-2008, 02:24 PM   #5
b4dp00fy
Bender Unit
 
Join Date: May 2008
Posts: 14
Smile

It's quite simple, calculate the distance between the two movieclips. In the first one when start dragging change the coordinates of the second with _xmouse+dist1 and _ymouse+dist2. Check out the .fla
Reply if this is helpful.
Attached Files
File Type: zip drag_multiple_mv.zip (6.5 KB, 1374 views)
b4dp00fy is offline   Reply With Quote
Old 05-29-2008, 01:20 AM   #6
senocular
six eyes
 
senocular's Avatar
 
Join Date: Jan 2003
Location: San Francisco, CA (USA)
Posts: 7,875
Send a message via ICQ to senocular Send a message via AIM to senocular Send a message via MSN to senocular Send a message via Yahoo to senocular
Default

2005, digging up an old one there
__________________
(6)
senocular is offline   Reply With Quote
Old 05-29-2008, 04:30 AM   #7
Gambyt
Member
 
Gambyt's Avatar
 
Join Date: Apr 2008
Posts: 92
Default

I actually just did this for my blog "under construction" page

ActionScript Code:
mc.onPress = startDrag; mc.onRelease = mc.onReleaseOutside = stopDrag;

It doesn't get much more simple than this

to make another movieClip follow the movieClip you are dragging you have to add a listener to the movieClip obj and that gets a little more in-depth than I have time for it's sack time for me. Yay NC

Last edited by Gambyt; 05-29-2008 at 04:33 AM.
Gambyt is offline   Reply With Quote
Old 05-29-2008, 02:43 PM   #8
b4dp00fy
Bender Unit
 
Join Date: May 2008
Posts: 14
Default

Quote:
Originally Posted by Gambyt View Post
I actually just did this for my blog "under construction" page

ActionScript Code:
mc.onPress = startDrag; mc.onRelease = mc.onReleaseOutside = stopDrag;

It doesn't get much more simple than this

to make another movieClip follow the movieClip you are dragging you have to add a listener to the movieClip obj and that gets a little more in-depth than I have time for it's sack time for me. Yay NC
Gambyt, this thread is about dragging multiple movieclips.
What you did is dragging just one.
b4dp00fy is offline   Reply With Quote
Old 05-29-2008, 04:05 PM   #9
senocular
six eyes
 
senocular's Avatar
 
Join Date: Jan 2003
Location: San Francisco, CA (USA)
Posts: 7,875
Send a message via ICQ to senocular Send a message via AIM to senocular Send a message via MSN to senocular Send a message via Yahoo to senocular
Default

There's also this:
http://proto.layer51.com/d.aspx?f=845
__________________
(6)
senocular is offline   Reply With Quote
Old 05-29-2008, 10:06 PM   #10
b4dp00fy
Bender Unit
 
Join Date: May 2008
Posts: 14
Default

It took me a lot of time to understand the entire code.
Anyway, I think the ideas are pretty similar, but I have less lines of code and it's more appropriate to begginers.
b4dp00fy is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Buttons, Actions, Movieclips, Drag and Drop, Multiples RobertJHJR ActionScript 2.0 1 04-22-2005 10:13 PM
Selecting Multiple MovieClips with Mouse Drag whiteboy ActionScript 2.0 6 10-18-2004 12:02 PM
drag multiple movies at once mad henkie ActionScript 2.0 1 05-11-2004 08:03 AM
Moving multiple movieclips at once madthijs ActionScript 2.0 4 03-15-2004 12:49 PM
magnifying lens for multiple movieclips sharvan11 ActionScript 1.0 (and below) 2 02-25-2004 10:01 AM


All times are GMT. The time now is 11:53 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.