script enable/disable problem

function OnGUI () {
    if (GUI.Button (Rect (10,70,70,20), "test" )) {
			var ball = gameObject.Find("ball main"); // find game object
			var com = ball.GetComponent("interestDrug"); // get javascript component
			com.test(); // test is com correct object - all right
			com.enable = false; // try turn off component
    }
}

and I get follow error:

MissingFieldException: Field 'interestDrug.enable' not found.
Boo.Lang.Runtime.PropertyDispatcherFactory.FindExtension (IEnumerable`1 candidates) 
Boo.Lang.Runtime.PropertyDispatcherFactory.Create (SetOrGet gos)

What is the problem? I’m looking for this forum and found such script, don’t understand where is my misstake. Could you help me?

Think you’re just missing a “d”.

com.enabled = false;

I’m stupid. You are right, surely!

But strange things, if I disable script and call method from this script it work ok - why?

function OnGUI () {
    if (GUI.Button (Rect (10,70,70,20), "test" )) {
			var ball = gameObject.Find("ball main");
			var com = ball.GetComponent(interestDrug);
			com.enabled = false;			
			com.test();

    }
}

Disabling a script tells Unity that you don’t want it to call functions in the script (update, start, awake, etc). You are free to call functions from scripts whether they are enabled or not.