# Can't change text on button

**URL:** https://forum.kirupa.com/t/cant-change-text-on-button/13598
**Category:** Uncategorized
**Created:** [February 15, 2003, 6:07am UTC](https://forum.kirupa.com/t/cant-change-text-on-button/13598 "2003-02-15T06:07:58Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![redd](https://avatars.discourse-cdn.com/v4/letter/r/3ab097/32.png) [@redd](https://forum.kirupa.com/u/redd)
#### Post date: [February 15, 2003, 6:07am UTC](https://forum.kirupa.com/t/cant-change-text-on-button/13598/1 "2003-02-15T06:07:58Z")

</div>

i am trying to develop a flash site where people can choose from a list of “skins” and when they do, the site color changes

i have a button with the instance name “home”. In the “Over” keyframe of this button i have a text box with the instance name of “overText”.

for the life of me, i can’t change the text color

i have used the following code

// set the color  
blue = 0x0000FF;

//set object and attibute  
menuTextStyle = new TextFormat ();  
menuTextStyle.color = blue;

//apply to the text field  
\_root.home.overText.setTextFormat (menuTextStyle);

i have also tried using \_root.overText; home.overText at the start of the text field path but these have’t worked either

can someone help?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 15, 2003, 6:20am UTC](https://forum.kirupa.com/t/cant-change-text-on-button/13598/2 "2003-02-15T06:20:15Z")

</div>

use a movie clip as button instead of a button =)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 15, 2003, 6:40am UTC](https://forum.kirupa.com/t/cant-change-text-on-button/13598/3 "2003-02-15T06:40:53Z")

</div>

i’m quite new to flash, could you give me an example of how that might work for my particular problem

thanks

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 15, 2003, 7:04am UTC](https://forum.kirupa.com/t/cant-change-text-on-button/13598/4 "2003-02-15T07:04:17Z")

</div>

well … i don’t know why need to change the format so maybe this is not what you wanted … :-\

anyway … there are two movie clips in the file

in one of the movie clips the script sets the text format automatically

in the other one the format changes onRollOver and onRollOut handlers

hope it helps =)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 15, 2003, 10:32am UTC](https://forum.kirupa.com/t/cant-change-text-on-button/13598/5 "2003-02-15T10:32:01Z")

</div>

thanks for the help kax

i have ended up creating a text field that sits below an invisible button - the button changes the text on rollout , rollover and also does all the on (release) things i originally had programmed

it may not be elegant but hey…  
=)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 15, 2003, 10:39am UTC](https://forum.kirupa.com/t/cant-change-text-on-button/13598/6 "2003-02-15T10:39:43Z")

</div>

ok … glad you worked it out =)
