Just running through a basic use scenario here -
public GameObject prefab; // drag your prefab here
GameObject go = Instantiate(prefab, Vector3.zero, Quaternion.identity) as GameObject;
var textMesh = go.GetComponent<tk2dTextMesh>();
if (textMesh != null)
{
textMesh.text = "Prefab: " + Random.Range(0, 100).ToString();
textMesh.Commit();
}
That should work fine. If you were doing this or you're still having problems, let me know.