Tutorial | Actionscript 3 Mouse Tracking (Video Tutorial)
by Carlos Pinho, May 4th, 2008
  • Share
  • Share

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.

[vodpod id=ExternalVideo.530261&w=425&h=350&fv=allowFullScreen%3Dtrue%26backColor%3D%23FFFFFF%26frontColor%3D%23FFFFFF%26gradColor%3D%23707070%26relatedVideos%3Dfalse%26creatorVideos%3Dfalse%26shareUrl%3DembedUrl%26pngLogo%3Dhttp%3A%2F%2Fstatic2.revver.com%2Fplayer%2Flogo%2Ffllogo70x20_.png]

Tags: , , , , , , , , ,

Copy and Paste the code below
Email and IM
Websites
Forums
Get This

No Responses to “Tutorial | Actionscript 3 Mouse Tracking (Video Tutorial)”

  1. Fun4MySpace.com Says:

    For those who are too lazy to type the code they saw in the video, here it is:

    var lineX:linex = new linex();
    var lineY:liney = new liney();

    addChild(lineX);
    addChild(lineY);

    stage.addEventListener(MouseEvent.MOUSE_MOVE,track)

    function track(e:event):void
    {
    lineX.y = mouseY;
    lineY.X = mouseX;
    }

    Want to play free flash games or put them on your MySpace or Facebook profile?
    Visit: http://www.fun4myspace.com
    Free Flash Games For Your Profile

  2. Alayas Says:

    there is an error !

    it says with this function

    function track(e:event):void

    !!

  3. gdfg Says:

    function track(e:event):void
    The e in event should be E

    lineY.X = mouseX;

    The .X should be .x

Let leave a Comments for this post.