get the value of a text field help me

Hi
I want to know how to get the value of a text field
i have create a textfield

/* GUI.TextField example */

var textFieldString = “Name”;
var posX : int;
var posY : int;

function OnGUI () {
textFieldString = GUI.TextField (Rect (posX, posY, 100, 30), textFieldString);
}

Now as I take the value when changed

The variable textFieldString is used twice :

  • In the function (what value the textField must show)
  • After the function (the function return the new value).

Simply use textFieldString, it contains the current content of the GUI textfield.

i test the server side highscores tutorial

the read values (Name end Score) work

now i whant insert the Name end the score whit 2 textfield end when press a botton the name end score insert in database whit call
function postScore(name, score)

I have insert 2 textfield e 1 bottom

how i can get the string edit from an textfild end pass it at function postScore

tenks.

function postScore (textFieldString, score) :wink:

not work

Code ?

what code?

post your code so we can have a look.

ok work i read the textfild

now i whant post Name end Score in the database whit call function postScore inculde in the HSController.js i whant call by another script i can?

I haven’t understood :?

How do I call a function outside the script which is contained

http://unity3d.com/support/documentation/ScriptReference/index.Accessing_Other_Components.html