View Full Version : Dynamic text, xml - change color on mouseover
shine
March 10th, 2009, 01:38 PM
Hi!
I want to change the color of the text on mouseover (its a dynamic text field).
I cant get it right! :sen:
/Sofia
SandeR2
March 11th, 2009, 04:14 AM
Sorry I don't really have any input at this point, but i'm trying the same. I'll let you know if I found a solution.
glosrfc
March 12th, 2009, 10:32 AM
Place the textfield inside a movieclip:
theString = "some sample text";
textHolder.theText.html = true;
textHolder.theText.htmlText = "<font color='#000000'>" + theString + "</font>";
textHolder.onRollOut = function() {
this.theText.htmlText = "<font color='#000000'>" + theString + "</font>";
};
textHolder.onRollOver = function() {
this.theText.htmlText = "<font color='#FF0000'>" + theString + "</font>";
};
Or you can use TextFormat instead of HTML:
theString = "some sample text";
textHolder.theText.text = theString;
theFmt1 = new TextFormat();
theFmt1.color = 0x000000;
theFmt2 = new TextFormat();
theFmt2.color = 0xFF0000;
textHolder.onRollOut = function() {
this.theText.setTextFormat(theFmt1);
};
textHolder.onRollOver = function() {
this.theText.setTextFormat(theFmt2);
};
meredevelopment
January 29th, 2010, 04:08 PM
Glosrfc... you are the (sex==man?"Man!!":"Woman!!")
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.