Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I change out text

Status
Not open for further replies.

askIllustrator

Technical User
Apr 20, 2001
698
DE
I want to have a button change the text in a dynamic text field. for example. changing the word ON to OFF. What is the MX way of doing this? Thanks.

"Great spirits have always encountered violent opposition from mediocre minds." -Einstein
 
One quick way...

On the main timeline...

my_textfield.text = "ON";
_global.but_status = true;

Then on the button...

on(release){
if (_global.but_status == true){
_global.but_status = false;
my_textfield.text = "OFF";
} else {
_global.but_status = true;
my_textfield.text = "ON";
}
}

Regards,

cubalibre2.gif
 
Thanks alot man, I almost get it. Do I have to have the textfield turned to dynamic text? Also could expand a little on what the global.but_status line does? thanks again.

"Great spirits have always encountered violent opposition from mediocre minds." -Einstein
 
Yes, the textfield has to be dynamic, so that it can be updated.
_global just sets the variable "but_status" as global, so that it can be set or read from anywhere in the movie.

Regards,

cubalibre2.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top