Skip to main content
Dec 1, 2015 1:24 PM UTC
Question

change text of a button

I wrote some text in the stage using the text tool, then I selected it and converted it to a symbol of type button, how can I change the text of this type of button? The Button name is btnBack, and if I double click it I can see that the name of the "text" is txtBack. I have tried the following:

btnBack.label = "test";

btnBack.text= "test";

btnBack["txtBack"] = "test";


btnBack.txtBack = "test";


btnBack.txtBack.text = "test";


But I cant change the text... How can I do it?



This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

Ned Murphy
Legend
Dec 2, 2015 1:49 PM UTC

Unlike MovieClips, which are dynamic objects for which you can define your own properties and methods, SimpleButtons have only the limited properties and methods designated by the SimpleButton class.  Since they do not have a textField in their base class, there is no such property that you can target.  You could probably extend the base class and add such a textField, but it is easier to just use a MovieClip symbol instead.

Translate
Inspiring
Dec 1, 2015 2:32 PM UTC

You can't change it.. it must be a movie clip not a button.

Translate