Hi, folks!
Easy question, that I can't quickly find an answer to online - it seems this would be in tutorials everywhere - and probably is...
I have a MovieClip that has a Dynamic TextField: let's call the instance of the field txtName. I want to set the text field on the fly for txtName, so I add a little ActionScript (3!) that does it nice and easily: txtName.text = "Foo";
Great. Now why isn't it working when I try the same thing from a parent MovieClip which contains the MovieClip that has the dynamic text? Example:
Child MovieClip with TextField ActionScript 3 in Frame #1:
//------
function SetText(str:String):void {
txtName.text = str;
}
//------
Parent MovieClip contains the above MovieClip (instance called movieChild) has the following ActionScript 3 in Frame #1:
//------
movieChild.SetText("Hello Child"); // Doesn't work
movieChild.txtName.text = "Hello Child"; // Doesn't work
MovieClip(movieChild).txtName.text = "Blah"; // Doesn't work
What simple thing am I missing? I know the text in the TextField actually gets set by checking it with a trace, but the display doesn't actually change.
Ready for an embarrasing and humbling answer.
Eddie