# Change text on rollover and change also color of a text on rollover

**URL:** <https://forum.kirupa.com/t/change-text-on-rollover-and-change-also-color-of-a-text-on-rollover/311417>\
**Category:** flash\
**Created:** [July 6, 2010, 11:45am UTC](https://forum.kirupa.com/t/change-text-on-rollover-and-change-also-color-of-a-text-on-rollover/311417 "2010-07-06T11:45:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mihaispr](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@mihaispr](https://forum.kirupa.com/u/mihaispr)\
**Post date:** [July 6, 2010, 11:45am UTC](https://forum.kirupa.com/t/change-text-on-rollover-and-change-also-color-of-a-text-on-rollover/311417/1 "2010-07-06T11:45:00Z")

</div>

![](http://img180.imageshack.us/i/butonr.jpg/)Hi everyone and thanks for reading my question!

I have a button with a text in it called Test1.

I want to change the text of the button in Test2 on RollOver over this button which instance name is btn1.

Initially the color of text of button is black. I also want on rollover to change it to white.

How can I achieve this?

I tried :

```auto
btn1.onRollOver = function()
{
    //var myText:TextFormat = new TextFormat();
    myText.text = 'Test2';
    myText.color='#FFFFFF'; // initially the color text (of Test1 word is black so it's #000000)
  
}

```

btn1 instance name for button

Test1 is the initial container of my button and it has instance name myText.

Look of my button:

[http://img180.imageshack.us/i/butonr.jpg/](http://img180.imageshack.us/i/butonr.jpg/)

Thanks in advance for helping me and sorry if it seems a basic question!

![](http://img180.imageshack.us/i/butonr.jpg/)
