Display variable from parent in textbox

I am trying to display a value in text that is taken from a variable in the parent. For example, I have a prefab sprite with an attached script that monitors stats of the sprite such as HP. I would like to have a textbox, which is a child of the sprite, display that value, but I can’t figure out how to do this.

What method do you use to read a variable from a parent for use in the child? I’ve read probably a dozen pages of similar questions and documentation but I just can’t seem to get it.

<< Put This Script On Your Text Object >>

Your Parent :

var Parent:GameObject = transform.parent.gameObject;

Read The Variable And Set It :

GetComponent(Text).text = Parent.GetComponent(YourScript).Variable;

Notice : This Code is For New UI System (Unity v4.6)