October 2nd, 2011, 06:34 AM
Question regarding Movie Clips and layers.
Wasn't sure what category to put this in because I'm using Flash Professional 8. I only know the basics, but I can't find an answer to this question anywhere. I'm making a simple drag-and-drop style dress up game, and I want to know if it's possible to combine multiple movie clips on different layers so that they can be gragged as a single object in the game, but retain their seperate layers. For example, if I make a hat and I want the front part of the hat to be on a layer above the doll base's head, and the back of the hat to be on a layer behind it, but the hat has to move as a whole when dragged. Is there any way to do this? Thanks in advance.
October 2nd, 2011, 06:45 AM
Hi, you would have to stop using the startDrag and stopDrag events and instead switch to using a combination of onMouseDown, onMouseMove and onMouseUp events instead.
So in the onMouseDown event you would assign the onMouseMove event. In the onMouseMove event you would set the position of the draggable objects to be _root._xmouse and _root._ymouse properties. Then in onMouseUp you would clear the onMouseMove event so things would stop moving.
You can see the Adobe example of those events here.
Quis custodiet ipsos custodes?
October 2nd, 2011, 07:47 AM
Thanks, that is exactly what I was after.