# Two scripts don´t work together

**URL:** <https://forum.kirupa.com/t/two-scripts-don-t-work-together/181511>\
**Category:** Uncategorized\
**Created:** [March 9, 2006, 10:29pm UTC](https://forum.kirupa.com/t/two-scripts-don-t-work-together/181511 "2006-03-09T22:29:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![benzrecordings](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/benzrecordings/32/1337_2.png) [@benzrecordings](https://forum.kirupa.com/u/benzrecordings)\
**Post date:** [March 9, 2006, 10:29pm UTC](https://forum.kirupa.com/t/two-scripts-don-t-work-together/181511/1 "2006-03-09T22:29:41Z")

</div>

hello,  
I try to build a naviagtion build of little dots.  
I want them to be magnet and it works fine. I took this script:

```php
onClipEvent (load) { 
    radius = 30; 
    startX = _x; 
    startY = _y; 
} 
onClipEvent (enterFrame) { 
    distance = Math.sqrt(Math.pow(_root._xmouse-startX, 2)+Math.pow(_root._ymouse-startY, 2)); 
    if (distance<radius) { 
        _x += _xmouse/3; 
        _y += _ymouse/3; 
    } else { 
        _x += (startX-_x)/3; 
        _y += (startY-_y)/3; 
    } 
}  

```

but I wan´t to move the buttons randomly in a small radius, I tried to put this script also on the MC:

```php
onClipEvent (load) { 
    xMax = 550;    
    yMax = 400; 
    xMin = 0; 
    yMin = 0; 
    hispeed = 8; 
    loSpeed = 6; 
    traegheit = 0.1; 

    grenzen = this.getBounds (this); 
} 

onClipEvent (enterFrame) { 
     
    
    xSpeed += ( xDrive - xSpeed ) * traegheit; 
    ySpeed += ( yDrive - ySpeed ) * traegheit; 
     
   
    if ( _x + grenzen.xMax + xSpeed > xMax|| _x + grenzen.xMin + xSpeed < xMin ) { 
        xSpeed *= -1; 
        xDrive *= -1; 
    }  
    if( _y + grenzen.yMax + ySpeed > yMax || _y + grenzen.yMin + ySpeed < yMin ) { 
        ySpeed *= -1; 
        yDrive *= -1; 
    }  
     
   
    _x += xSpeed; 
    _y += ySpeed; 
   
    if ( xDrive - xSpeed < 0.1 && xDrive - xSpeed > -0.1 && yDrive - ySpeed < 0.1 && yDrive - ySpeed > -0.1 ) { 
        do { 
            xDrive = Math.random () * hiSpeed;
            xDrive *= ( Math.random () > .5 ) ? 1 : -1;
            yDrive = Math.random () * Math.sqrt (Math.pow ( hiSpeed, 2) - Math.pow (xDrive, 2) ); 
            yDrive *= ( Math.random () > .5 ) ? 1 : -1; 
        } while ( Math.sqrt ( Math.pow ( xDrive, 2 ) + Math.pow (yDrive, 2 ) ) < lospeed ); 
    } 
}  

```

but when I put both scripts on the MC nothing happens anymore, I think they are blocking each other. Is it possible, that the MC´s are doing both?

thanx
