I’ve got a dynamic text field in my button object. I have named the text field “myText”. How can I modify the text within it? myButton.myText.text = "test"; won’t work, because it can’t access myText.
I’ve got a dynamic text field in my button object. I have named the
Share
I usually just create a MovieClip that contains a blank button and a dynamic text field.
If you set
mouseEnabled = falseon the text field, it won’t interfere with the mouse events on the button.Edit:
Here’s and example of a custom button class I use sometimes:
}
You can link this to a MovieClip that has frames labeled “normal”, “over” and “down” and it will function like a normal button with a dynamic label.
If you need to customize the text appearance for the different states you can do so within the event handlers.