Deactivate a textfield with code

Hi, How can I deactivate a blinking textfield with code. Like when you click in the main screen field? I need to shift the focus from the textfield to the main screen.So far I have this…

GUI.TextField enabled = false;

http://unity3d.com/support/documentation/ScriptReference/GUI.FocusControl.html

I would try empty string for the name to see if that unfocuses all???

I am not sure what you mean by “blinking textfield” ? but the GUI.Textfield only shows up if you have it in your OnGUI() loop.

So I would make a simple boolean variable as a flag/state that says weather to show this Textfield or not.

Like:

void Awake()
{
   bool isTextfieldActive = true;
}

void OnGUI()
{

   if (isTextfieldActive) 
   { 
      stringValue = GUI.Textfield (stringValue, blah blah......);
   }

   if(GUI.Button(...a button to toggle the textfield...))
   {
      isTextFieldActive = !isTextfieldActive;
   }
 
}