A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Replicate movement question

  1. #1
    Senior Member
    Join Date
    May 2003
    Posts
    160

    Replicate movement question

    hello all, here's my problem..

    I have two MCs on screen.
    One MC follows the mouse around the stage.
    What I would like to happen is to have the other MC to replicate the movement on stage while being independent of the mouse cursor.

    anyone, please!? it's driving me crazy.

  2. #2
    Senior Member hum's Avatar
    Join Date
    Sep 2003
    Location
    CloudCuckooland
    Posts
    1,714
    Hi
    Here is one way...
    Example:
    2 movieclips on stage....mc1....mc2,

    This goes on mc1
    code:
    onClipEvent (mouseMove) {
    _x = _parent._xmouse;
    _y = _parent._ymouse;
    updateAfterEvent();
    }



    Then this goes on mc2
    code:
    onClipEvent (enterFrame) {
    this._x += (_parent.mc1._x-this._x)/2;
    this._y += (_parent.mc1._y-this._y)/2;
    }


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