Skip to main content
Inspiring
January 16, 2013
Question

how to bring mouse point to a particular position

  • January 16, 2013
  • 1 reply
  • 957 views

Dear Friends,

i need to bring my mouse cursor point to a particualr place in my stage after click on a particular button. is there any way to bring my mouse cursor to a particular point?

for example: after click on my button:

mouseX = 100;

it tells as mosueX is read only..:)

pls provide me some alternate...

Regards,

Syed Abdul Rahim

This topic has been closed for replies.

1 reply

Inspiring
January 16, 2013

You could use a Virtual Mouse or a Custom Cursor that would help you to fake such a behaviour.

rahimhajiAuthor
Inspiring
January 16, 2013

Dear Mr.Mocca,

Greetings! thks for the answer. I did my own custom (hand) mousepointer.. when the user clicks on a particular button, hand will be vanished and mouse will be shown. When our computer mouse shown to the user, it starts from the place where we clicked. so i want to bring my mouse pointer back in different place like bottom of the screen. My custom mousepointer will come in particular time only.. after clicks on that area it will go...

pls any help my friends..?

Thanks and Regards,

Syed Abdul Rahim

Inspiring
January 16, 2013

It must be clear that actually controlling the users mouse is not possible.

That is why I wrote "fake".

I´give you an example:

Say I have two buttons A and B that I want to have the user click consecutively, that means, if he clicks A it is mandatory for him to click B, but I obviously can`t force him to click it.

When he clicks A, I call

Mouse.hide() and excange the systems cursor with a MovieClip that looks identical.

Then I position this clone at the position the original cursor (that is now hidden) sits.

Then I Tween this clone to the Position where Button B sits and "fake" my clicked animation.

Now in the meantime between this two clicks the User could have moved his mouse anywhere on Stage or even out of your applications focus to the browser menu.

So when I have fake-clicked my Button B I tween my clone whereever the users mouse sits (or to the point where he left the stage) and then I re-exchange the Clone with the original by setting the clone`s visible property to false and calling

Mouse.show()

PS: I just saw that you have another related thread on this forum:

How to restrict the custom mouse cursor area

And that you started to mixup the two subjects. That`s actually not very helpful.

It was a good decision to seperate the problems, the more defined/concentrated your problem, the greater is the chance you will get a solution quickly.

Just my 2 cents ;-)