Skip to main content
Known Participant
October 7, 2007
Question

Dragging and Dropping Buttons /MC questions

  • October 7, 2007
  • 18 replies
  • 1743 views
I created a flash movie with a lot of buttons for dragging and dropping around in the stage.
I wanted to make it such that even if i drag one of the button away from its original position, a new same button will appear at exactly the same position. Also, i would like to make it that some buttons are always on top of the other items when being dragged and dropped.
How do i do this?

I am only able to code the dragging and dropping part, but not able to do the rest whereby some buttons are always on top of the others and there will be new same button when the button was being dragged.
I do not know how do i code for movie clip, is it better to use movie clip instead of buttons?
This topic has been closed for replies.

18 replies

kglad
Community Expert
Community Expert
December 6, 2007
you're welcome.
IreDevilAuthor
Known Participant
December 5, 2007
Ok pals, thanks for all the help till now.
I will try to solve it.

Participating Frequently
November 12, 2007
If I may make a suggestion, IreDevil, it's that it seems you're trying to run before you can walk, so to speak. Step away from the project, and do some self-tutorials. Build some samples using drag and drop functionality, get depth sorting and drag and drop down pat, then make it more complicated. Eventually you'll gain enough understanding of drag and drop and events and depths that your experiments will be at the same level as what you're trying to achieve in your project. Then you may be better able to digest the solutions that have been offered here.
kglad
Community Expert
Community Expert
November 12, 2007
there's a limit on what i'll do without charging. and that's beyond my limit.
kglad
Community Expert
Community Expert
October 25, 2007
use the code i gave but add a this.swapDepths(this._parent.getNextHighestDepth()) in all your movieclip's onPress handlers.
IreDevilAuthor
Known Participant
November 11, 2007
I've tried adding a this.swapDepths(this._parent.getNextHighestDepth()) to all my mc's onPress event but it doesnt work for me. Right now my coding are as follow:
Should i let u see the fla file?
IreDevilAuthor
Known Participant
October 25, 2007
What i actually want to do is something like a notepad for maths problem.
There will be numbers from 0 to 9, and other symbols like + - x and division.
Students can just drag these numbers or symbols onto the notepad and do their own calculation from there.

Also, there will be another set of numbers from 0 to 9, but in smaller size for the multiplication working's 'carry numbers'. That is why i need the dragged movieclip to have its duplicate at its starting position.
kglad
Community Expert
Community Expert
October 24, 2007
i don't know because i'm not sure what you're trying to accomplish.
kglad
Community Expert
Community Expert
October 24, 2007
a duplicate can't be ontop of the movieclip that's pressed or it will intercept the mouse events.
IreDevilAuthor
Known Participant
October 24, 2007
Ah... so how should i do it then??
IreDevilAuthor
Known Participant
October 24, 2007
Hmm... because i have certain movieclips that its duplicate need to be ontop of all the other movieclips. For example, only special_mc needs to be on top of all other movieclips but the rest of the movieclips do not need to be ontop of the others.

For number 2, I don't know why but i am not able to drag its duplicate out from its starting position.

X_x
IreDevilAuthor
Known Participant
October 24, 2007
I don't know why but this code doesnt work for me too.
I am able to drag out only one mc and have a duplicate being positioned at the same position. But i am not able to drag the duplicate out from the same position.

Here's what i want actually:
1) when a movieclip starts to be dragged, create a duplicate of it located at its start position

2) the duplicate can be dragged as well and when it is being dragged, there will be another duplicate of it at its start position.

3 ) 2 version of the dragged movieclip; (a) should be above the other movieclips & (b) are not above of the other movieclips

Is it possible to do it?
X_x
kglad
Community Expert
Community Expert
October 24, 2007
the code i gave does 1 and 2. and i have no idea what you mean by 3.