A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: array from mouse movement

  1. #1
    Senior Member
    Join Date
    Oct 2002
    Posts
    412

    array from mouse movement

    Hi All,

    Does anyone know how I can generate arrays from the mouse movement of my cursor.

    I need to create some x & y arrays from the position of the cursor as it moves around the stage - does anyone know how I can do it?

    Not so much a case of recording the mouses movement within the movie more collecting the data from it to use elsewhere? Does that make sense? - hope so.

    Really appreciate any help folks


  2. #2
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    Code:
    var coordsArray = [];
    var intId = setInterval(function() {
        coordsArray.push({x: _root._xmouse, y: _root._ymouse});
    }, 500);
    would add an object with properties x and y (containing the x and y position of the mouse) to then end of an array every half a second.

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