Skip to main content
Known Participant
June 14, 2011
Question

User Draw Line

  • June 14, 2011
  • 1 reply
  • 1013 views

I am constructing a matching game where the user will draw a line between two items.  Has anyone done this or know of an example code wise that would help me.  I am not sure how to constrain the line to just between the items or how to know if the correct two items have been connected. Thanks in advance.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
June 14, 2011

do you know how to draw a line using actionscript?


Known Participant
June 14, 2011

Yes with the lineTo.   That is what I am wanting to do .. all actionscript with the line draw.

kglad
Community Expert
Community Expert
June 14, 2011

if each of your to-be-connected objects is a movieclip, you can assign a property (eg, match) to each that stores its match.  then when your line draw from a starting movieclip is complete you can check for a mouse hittest with that movieclip's match property.