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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mouse position by Lingo relative to a dragable object

Status
Not open for further replies.

gcarcass

MIS
Jul 16, 2005
8
JP

Hello:

I have a huge problem, at least for me. So far I've been using this little code(Buddy API) to locate the cursor on a specific location on the stage, over an object:

on enterFrame me
baPlaceCursor(x+the stageleft , y+the stagetop)
and

But now I got really complicated, why? I need to do the same, but prior to the "scene" in which the mouse "automatically" jump from one position to another, the user has the preference of moving the object, which before was static, therefore easy to "pre-define" the coordinates with that little code.

To drag the objects I'm using the MULTIPLE SPRITE DRAG. Then the user can go to a different "scenes" in which the cursor will "automatically" move over to the new position over the object, and if the user wants to change the position of the object again, then the mouse will jump over the object's new position again, and then.... well basically the same.

I guess I have to put the coordinates of the object when it's moved in a global variable and then update the "mouse position code" by retrieving that information. BUT!!! I do not know how to do it.

Any Clues, help, comments, suggestion, examples, scripts, whatever will be highly appreciated.

Thanks !!!!!
 
I guess I have to put the coordinates of the object when it's moved in a global variable and then update the "mouse position code" by retrieving that information."

You've answered your own question! Just use [tt]locH[/tt] and [tt]locV[/tt] to get the position of the sprite and assign the value to global variables.

Kenneth Kawamoto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top