all groups > flash actionscript > november 2004 >
You're in the

flash actionscript

group:

Drag & Drop and Rotating Objects


Re: Drag & Drop and Rotating Objects David Stiller
11/17/2004 4:43:10 PM
flash actionscript:
Not being an AS guru ... that will make it harder, for sure. ;)

You might consider performing the drag itself on the individual movie
clips. You've said you're cool with that. To get the rotating, place four
instances of a new movie clip nested inside each of your other ones. eg.,
if you have a "desk" movie clip, it will be a rectangle. Inside that movie
clip, add a new layer at the top and put four circles near the four corners
of the desk. You can make these button symbols with hit states only, so
they're invisible.

When the mouse is over the desk, do a drag. When the mouse is over one
of the corner buttons (or movie clips; your pick), perform a rotation.


David
stiller ( at ) quip ( dot ) net

Drag & Drop and Rotating Objects phej
11/17/2004 9:22:26 PM
I have a client that wants something similar to this:
(http://www.thewelborn.com/floorplans3.htm) but wants the user to be able to be
able to rotate the furniture icons to better position them. I can do the drag
and drop and I can do the rotate, I can not, however figure out how to do drag
and drop and then rotate and then repeat. Is it impossible or do I not see the
forest for the trees? And not being an AS guru could possibly be my problem,
so any advice/answers anyone has, please provide rough sample code (if you
can). Thanks in advance!:music;
Re: Drag & Drop and Rotating Objects Rothrock
11/17/2004 9:50:40 PM
Well how would that work in general? (Regardless of the code.) How would the
mouse know that this movement is for rotation and this is for dragging? Some
ideas would be to add control points that appear when you get near the object,
if you click and drag this it will rotate if you click and drag this it will
move. Or perhaps you could add a modifier key? Once you come up with an idea
for how you would like to make it work, then we can begin working on a solution.
Re: Drag & Drop and Rotating Objects phej
11/17/2004 10:00:59 PM
I was thinking of having a rotate button somewhere on the screen so that the
user would drag a bed wherever they wanted it and then could click on the
rotate button to move it 90 degrees. My problem with that is that how do I
tell the rotate button which object to rotate and yet have it be usable for all
the icons. The icons would be small so having two buttons on the icon (one to
drag and one to rotate) could be confusing. Perhaps having the icon itself
dragable and adding a rotate button that appears on icon rollover that rotates
it 90 degrees per click. What do you think? Is that possible?
Re: Drag & Drop and Rotating Objects NSurveyor
11/17/2004 11:34:31 PM
Re: Drag & Drop and Rotating Objects jthereliable
11/18/2004 1:47:11 AM
Just for the Newsgroup User guy... If the mouse is on Drag already, how would
you move the mouse over to one of the 4 corners? It is impossible because the
movieclip would also be moving with the mouse, moving the 4 circles also. You
mentioned to put it only on the hit state. I would suggest to put it on the
over state. To phej, I suggest you to use the Newsgroup User's idea. It is
quite resonable if you understand what it is asking for. I would suggest that
on the corner buttons, make it like, on the rollover state, _parent._rotation
+= 5 or around there. Depends on which corners you put it on.
Re: Drag & Drop and Rotating Objects NSurveyor
11/18/2004 1:58:39 AM
Re: Drag & Drop and Rotating Objects phej
12/13/2004 2:32:30 PM
Dude! You rock! That's exactly what I need.

Are you able to upload or email the fla's to me - the link appears to be dead.

Re: Drag & Drop and Rotating Objects NSurveyor
1/29/2005 5:59:50 PM
AddThis Social Bookmark Button