# \[MX\] Movie Clip "attraction"

**URL:** <https://forum.kirupa.com/t/mx-movie-clip-attraction/151427>\
**Category:** flash\
**Created:** [June 15, 2005, 1:02pm UTC](https://forum.kirupa.com/t/mx-movie-clip-attraction/151427 "2005-06-15T13:02:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![xiaopenguin](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/xiaopenguin/32/986_2.png) [@xiaopenguin](https://forum.kirupa.com/u/xiaopenguin)\
**Post date:** [June 15, 2005, 1:02pm UTC](https://forum.kirupa.com/t/mx-movie-clip-attraction/151427/1 "2005-06-15T13:02:01Z")

</div>

How would I write a script making movie clips attracted to each other, while incoporating it into their own movement functions?  
For example, “mc\_1” has this script:  
this.onEnterFrame = function () {  
this.\_x += 5;  
this.\_y += 5;  
}  
And “mc\_2” isn’t loaded onto the stage until the viewer clicks, through a listener or just a plain \_root.onMouseDown function.

A pre-made example of the movement I’m trying to get is the “Interactive Buddy” swf, found here:  
[http://www.flashplayer.com/games/interactivebuddy.html](http://www.flashplayer.com/games/interactivebuddy.html)  
The “Weak Gravity Vortex” under God Powers is exactly what I’m talking about.
