# \[fmx\] colour change for textfield on rollOver

**URL:** <https://forum.kirupa.com/t/fmx-colour-change-for-textfield-on-rollover/20133>\
**Category:** flash\
**Created:** [May 5, 2003, 6:45pm UTC](https://forum.kirupa.com/t/fmx-colour-change-for-textfield-on-rollover/20133 "2003-05-05T18:45:41Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![eudora](https://avatars.discourse-cdn.com/v4/letter/e/f14d63/32.png) [@eudora](https://forum.kirupa.com/u/eudora)\
**Post date:** [May 5, 2003, 6:45pm UTC](https://forum.kirupa.com/t/fmx-colour-change-for-textfield-on-rollover/20133/1 "2003-05-05T18:45:41Z")

</div>

myMC.onRollOver = function(){  
var newColor2=“0x000000”;  
myColor = new Color(myMC.output);  
myColor.setRGB(newColor2);  
}

on myMC movieclip contains a textfield output…  
is this the correct way to change the colour for the text?

is there a way to change the background color of a textfield without borders?

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:** [May 5, 2003, 11:12pm UTC](https://forum.kirupa.com/t/fmx-colour-change-for-textfield-on-rollover/20133/2 "2003-05-05T23:12:30Z")

</div>

you use the textColor property of the TextField.

```auto
myMC.onRollOver = function() {
this.myTextField.textColor = 0x000000;
};

```

=)

---

<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:** [May 6, 2003, 2:31am UTC](https://forum.kirupa.com/t/fmx-colour-change-for-textfield-on-rollover/20133/3 "2003-05-06T02:31:08Z")

</div>

hmmz am i rite to say that this onRollOver function shld appear before attachMovie code? so that the movie have this function?

---

<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:** [May 6, 2003, 2:40am UTC](https://forum.kirupa.com/t/fmx-colour-change-for-textfield-on-rollover/20133/4 "2003-05-06T02:40:18Z")

</div>

you can use the method that senocular explained to you…

```auto
changeTextColor = function () {
this.myTextField.textColor = 0x000000;
};
myMovieClip.attachMovie("myLibraryClip", clipA, 1, {onRollOver:changeTextColor});

```

😉

---

<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:** [May 6, 2003, 3:41am UTC](https://forum.kirupa.com/t/fmx-colour-change-for-textfield-on-rollover/20133/5 "2003-05-06T03:41:01Z")

</div>

hmmz… okok i will try again… how abt changing the background colour of a textfield?

also for the rollOver function codes… the “this” refers to myMovieClip or the movieclip that i am attaching to?

---

<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:** [May 6, 2003, 3:53am UTC](https://forum.kirupa.com/t/fmx-colour-change-for-textfield-on-rollover/20133/6 "2003-05-06T03:53:35Z")

</div>

**this** refers to the object that is calling the function. in the script above, it’s the same than clipA.myTextField.

and to change the background use the backgroundColor property.

check the actionscript dictionary… everything is there. :-\

---

<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:** [May 6, 2003, 4:05am UTC](https://forum.kirupa.com/t/fmx-colour-change-for-textfield-on-rollover/20133/7 "2003-05-06T04:05:57Z")

</div>

okok 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:** [May 6, 2003, 4:07am UTC](https://forum.kirupa.com/t/fmx-colour-change-for-textfield-on-rollover/20133/8 "2003-05-06T04:07:01Z")

</div>

no problem. :beam:
