For future, you're probably best off keeping this kind of conversation in the original question, but at least you've referenced it here...
Your problem is that both name
and text
are individual properties of a button. To change the text, you just want this:
child.text = "New text"