How to add OnMouseEnter to another object?

Hi,
I’m trying to set some functions like OnMouseEnter for other objects from a single script.
I mean I’m trying to do something like:

var OtherObjects:GameObject[];

OtherObjects.OnMouseEnter = function(){
do_something();
};

Can I do something like this?

I have a work around in C# by using a delegates. However, I am not sure whether if JavaScript have anything equivalent or similar to delegates. You will have to figure it out yourself, if you want it in JS.

Mouse Receiver

public delegate void Action();

public class MouseReceiver : MonoBehaviour {
   public Action onMouseEnterAction;

   void OnMouseEnter() {
      if( onMouseEnterAction != null ) {
         onMouseEnterAction();
      }

   }
}

In another script

public class Setup : MonoBehaviour {

   MouseReceiver a, b, c;

   void Start() {
      a.onMouseEnterAction = delegate() {
         Debug.Log("OnMouseEnter A");
      };

      b.onMouseEnterAction = delegate() {
         Debug.Log("Mouse just entered B");
      };

      c.onMouseEnterAction = delegate() {
         Debug.Log("C!!");
      };
   }
}