dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: capture a click without use of a button

  1. #1

    capture a click without use of a button

    Is there any way that I can capture the root _x and _y coordinates of the mouse anytime I click, no matter what I click as long as it is inside the flash movie? thanks in advance.

  2. #2
    Senile member! :)
    Join Date
    Dec 2001
    Location
    Saunaswamp (transl)
    Posts
    2,296
    The onClipEvent(mouseDown) will register that the mouse button was pressed even if it's outside the movieclip.

    you could do something like this:

    Code:
    _root.onMouseDown = function()
    {
        trace("X:" + _xmouse + " Y:" + _ymouse)
    }
    It'll trace out the mouse position everytime the left mousebutton is pressed.

    /Mirandir

  3. #3
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food
    Posts
    3,789
    Code:
    click = new Object();
    click.onMouseDown = function() {
    	trace("Mouse X: " + _xmouse);
    	trace("Mouse Y: " + _ymouse);
    };
    Mouse.addListener(click);

  4. #4
    Both worked, I am assuming the second is somehow superior thanks both of you.

    o b s o l e e t

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center