Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Snapping a graggable object

Status
Not open for further replies.

ebrowning

Programmer
Feb 6, 2001
6
GB
Can anyone tell me if it is possible to snap a draggable object to another object when the cursor is say 10 pixels from it?

If so, any pointers would be appreciated, I'm quite new to Flash.

Ed.
 
2 options:

Use the getproperty action to determine the x/y position of your dragged mask, along with an if statement containing a setproperty action to lock the position if it crosses the target location.

or, probably better...

On your draggable clip set a variable (say x=1) when the drag is commenced. Create a transparent button in the required target location with an action which (on rollover) firstly stops the drag if x=1 and secondly sets the x/y positions of the movie-clip to the required location.

dD davdesign@hotmail.com

^^^^^^^^^^^^^^^^
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top