PDA

View Full Version : [fmx] colour change for textfield on rollOver



eudora
May 5th, 2003, 02:45 PM
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

kode
May 5th, 2003, 07:12 PM
you use the textColor property of the TextField.

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

eudora
May 5th, 2003, 10:31 PM
hmmz am i rite to say that this onRollOver function shld appear before attachMovie code? so that the movie have this function?

kode
May 5th, 2003, 10:40 PM
you can use the method that senocular explained to you...

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

eudora
May 5th, 2003, 11:41 PM
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?

kode
May 5th, 2003, 11:53 PM
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. :-\

eudora
May 6th, 2003, 12:05 AM
okok thanks.. :)

kode
May 6th, 2003, 12:07 AM
no problem. :beam: