How does one call a script method on the object you've collided with?

//obj 1’s collision code
function OnTriggerEnter( Otherobject : Collider) {

    //how can I make this work?
    //i want the other object to do something internally when it's hit by obj1
    Otherobject.gameObject.dosomething();

}

//other object

static function dosomething() {

 Gameobject.danceAround();

}

You don’t want the other dosomething function to be static.

You can then do this:

    Otherobject.GetComponent(NameOfOtherScript).dosomething();