dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: On Mouse move

  1. #1
    Member
    Join Date
    Feb 2003
    Posts
    55

    On Mouse move

    Hi all,

    I am trying to move an "mc" when my mouse moves.
    I used these 3 lines of code which does the job but i was wondering how can i apply an "ease" effect so that my "mc" moves smoother!

    onMouseMove = function() {
    contents._y = (_root._ymouse);
    updateAfterEvent();
    }

    Any help is appreciated.

    Thanks

  2. #2
    I know nothing.
    Join Date
    Feb 2008
    Posts
    315
    Can you post a preview of what you're working on? You may just need to add a tween...

  3. #3
    Member
    Join Date
    Feb 2003
    Posts
    55

    On Mouse move

    I basically found what i wanted to do.

    "contents" is the instance name of my movie clip.
    ------------------------------------------------------
    contents.onEnterFrame = function() {
    var yMouse = _root._ymouse;
    if(Math.abs(yMouse - this._y) < 1) {
    this._y = yMouse;
    } else {
    this._y -= (this._y-yMouse) / 6;
    }
    }
    -----------------------------------------------------
    Thanks for the interest anyway!

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