New 4.6 UI text

How do I change or target the text script through code? Where is the old 3D text from before 4.6? (TextMesh)

You can still add a TextMesh component to an object if you want.

And when using a new text is:

gameObject.GetComponent<Text>().text = "new text";

to change the string value of the text.

Requires: using UnityEngine.UI;

Hi. Not sure if this is helpful but I hope it does.

#pragma strict
var dt : System.DateTime = System.DateTime.Now;
var h :  int = dt.Hour;
var m : int = dt.Minute;
var displayTime : String;
var s : int = dt.Second;

function Start () {
	displayTime = gameObject.GetComponent(UI.Text).text;

function Update () {
	displayTime = (h+":"+m"+s);
	gameObject.GetComponent(UI.Text).text = displayTime;