Change dynamic text

I’ve got a mc with a dynamic text field in it.(using the mc as a button, and the text is the button label). I dragged two instances of the clip onto the stage and gave them each an instance name. (button1 & button2). Also, within the clip, I gave my dynamic text field and instance name of ‘myText’.
So what I want, is to be able to change the text for each button. Since if you do this manually, the text changes for every button. So I slapped this in the first frame of the main timeline.


button1.onLoad = function() {
this.myText.text = "home";
}

button2.onLoad = function() {
this.myText.text = "about";
}

Not working. Anyone got an answer?

Use:

button1.myText = “home”;
button2.myText = “about”;

That will just directly tell them to change. You dont need an onLoad just put the code where the buttons come into play :smiley:

~ Lacuna :love:

That doesn’t work either, I had tried that be4 posting. I tried to just simply make a dynamic text field into a movie clip, then change each instance of the text, and that did’nt work for me. Unless there is something wrong in the properties, like it needs to be multiline or something, I don’t know. Could you post an example fla possibly?

button1.myText.text = “home”;
button2.myText.text = “about”;

Sorry for not mentioning Digital, the .text was part of what I had tried. Could you maybe post something?

http://digitalosophy.com/Kirupa_Files/Flash/nasty.fla