flash on mouse move???

Out of context: Reply #4

  • Started
  • Last post
  • 5 Responses
  • Mishga0

    Got it! =)
    When i rollover the button, the graphic follows the mouse, when i rollout the graphic goes to the coordinates I'll tell to go:

    [CODE]
    area.onRollOver = function() {
    graphic.onEnterFrame = function() {
    var xMouse = _root._xmouse;
    var yMouse = _root._ymouse;
    if (Math.abs(xMouse-this._x)<1) {
    this._x = xMouse;
    this._y = yMouse;
    } else {
    this._x -= (this._x-xMouse)/6;
    this._y -= (this._y-yMouse)/6;
    }
    };
    };
    area.onRollOut = function() {

    delete graphic.onEnterFrame;

    graphic.onEnterFrame = function() {
    var xOrigin = 20;
    var yOrigin = 20;
    if (Math.abs(xMouse-this._x)>1) {
    this._x = xOrigin;
    this._y = yOrigin;
    delete graphic.onEnterFrame;

    } else {
    this._x -= (this._x-xOrigin)/6;
    this._y -= (this._y-yOrigin)/6;
    }
    };

    };

    [End CODE]

    • now you need to work on that spring effect...=)Mishga

View thread