I have a simple movieclip, with an object moving from point A to point B. This movieclip is then placed on the canvas, and I have applied the following code to allow the user to drag and drop the movieclip (when the movieclip is clicked to drag, the animation stops), and for events to occur when the movie clip hits target areas:
The issue I am having is that I would like ONLY the object in the movieclip to be clickable, and at the moment, the path (invisible) of the object is also registering as part of the movieclip and it is clickable to drag. For example, if my object is a 10 px square, moving from coordinates x=0 to x=400, my "clickable" dragging hit area seems to be the entire 400px. When the 10px square is at x=300, I can click into empty space at x=50 and drag the movieclip. What I'd like to do, is make only the 10px square clickable.
What do you suggest??
Thank you in advance for your time!
If the path for dragging is a straight line (or fixed area) then you do not need to create a path. You can specify the drag limits as an argument (Rectangle) in the startDrag function.