[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 191
  • Last Modified:

Is it possible to set the mouse position programatically?

I would like to be able to set the mouse to a specific location on a button click.  Is that possible?  
0
dtburdick
Asked:
dtburdick
1 Solution
 
negatyveCommented:
Simply, (and this is good), no. You can create a fake mouse pointer, hiding the real one, and move it to a specific location, but you cannot change in any way the real mouse position.

For example:

Mouse.hide();
var mc = this.attachMovie("fakePointer", "cursor", 10000);
mc.onMouseMove = function()
{
      this._x = _root._xmouse;
      this._y = _root._ymouse;
      updateAfterEvent();
};
mc.onMouseMove();
yourButton.onRelease = function()
{
      delete mc.onMouseMove;
      mc._x = yourlocationX;
      mc._y = yourlocationY;
}
0
 
dtburdickAuthor Commented:
:(

Thanks.  Now I have to use my brain.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now