Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Actionscript 3 Mouse Tracking Tutorial

Loading...

Sign in or sign up now!
6,992
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Mar 30, 2008

A video tutorial showing how to create two movieclips that follow the X and Y coordinates of the mouse to give a target like effect, this is ideal for shooting type games.

Category:

Howto & Style

Tags:

License:

Standard YouTube License

  • likes, 2 dislikes

Link to this comment:

Share to:
see all

All Comments (15)

Sign In or Sign Up now to post a comment!
  • include fucking sound plz..

  • at 0:43 do you just delete the line?

  • wow nice tutorial very explanatory

  • Yeah that's the way I learned to do it. Saves sooo much time when making crosshairs to just save that snippet in ASExpander as &crosshair, turning this 6 minute long tutorial into something that can be done in just a few seconds ^.^ (workflow speed FTW)

  • Mouse.hide();

    var lineX:linex = new linex();

    var lineY:liney = new liney();

    addChild(lineX);

    addChild(lineY);

    stage.addEventListener(MouseEv­ent.MOUSE_MOVE, track);

    function track(e:Event):void{

    lineX.y = mouseY;

    lineY.x = mouseX;

    }

  • awsome! good stuff

  • can you post the code so we can copy it

  • i was kidding xD

  • It* ^^^^^^^

  • lol wot thats pathetic kit just makes it easier!!

Loading...

0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more