Posted By

sicbot on 03/29/08


Tagged


Versions (?)

mc._x & _xmouse navigation


 / Published in: ActionScript
 

has a movie clip move left and right. Opposite Direction then the mouse.

  1. var targetX:Number;
  2. this.onEnterFrame = function() {
  3. targetX = -1.6 * _xmouse
  4. gl_mc._x += (targetX - gl_mc._x) / 5;
  5. };

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: SmpleJohn on March 31, 2008

AS 3.0 VERSION

var targetX:Number;

stage.addEventListener(Event.ENTER_FRAME, moveMC);

function moveMC(e:Event):void { targetX = -1.6 * mouseX; glmc.x += (targetX - glmc.x) / 5; };

You need to login to post a comment.