Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change the color of dynamictext 1

Status
Not open for further replies.

Bignewbie

Programmer
Feb 22, 2001
351
PH
hi guys,

is there any way to change the color of a dynamic textbox.
for example, initially, black is the color of my dynamic textbox. when i click a button, i want it to change to white. hope to hear from u soon!


thanks

biggie
 
Hi Big,

Would be a little different if you worked from a loaded text file or from a simple text variable. From a text variable within the movie, you would only have to use a second text variable (in fact a copy of the first one!), with <color> tags like these:

_root.textfield2 = &quot;<u>THIS IS THE FIRST LINE... </u><font color=\&quot;#FFFFFF\&quot;>THE PREVIOUS LINE WAS UNDERLINED AND IN THIS ONE, THE TEXT COLOR HAS BEEN CHANGED FROM BLACK TO WHITE.<font color=\&quot;#0000FF\&quot;>...AND THIS LAST LINE OF TEXT WILL APPEAR IN RED!&quot;;

On the button press, you would then simply use something like:

_root.textfield1 = _root.textfield2;

You could also load a new external text.txt file holding the same tags:
_root.textfield2=<FONT FACE=&quot;Arial&quot; SIZE=&quot;10&quot; COLOR=&quot;#0000CC&quot;><B>Scrolling a text box with a diagonal scrollbar!</B></FONT><BR><BR><FONT FACE=&quot;Arial&quot; SIZE=&quot;11&quot; COLOR=&quot;#00FF00&quot;>Oh oh, don't you just love this new scroller? It looks practically the same as an OS scroller. Stop confusing your users with weird navigation schemes: use an OS scroller.</FONT><BR><BR><FONT FACE=&quot;Arial&quot; SIZE=&quot;11&quot; COLOR=&quot;#0000FF&quot;>Anyway, as you can see, lots of things have been added to this one. First of all, this one got rid of the anoying hand cursor when you rollover the buttons. Second of all, the text is loaded from an external text file. Finally, and most important, a scroll bar has been added for your scrolling pleasure.</FONT><BR><BR><FONT FACE=&quot;Arial&quot; SIZE=&quot;11&quot; COLOR=&quot;#FF0000&quot;><BR>Now stop scrolling and read the damn tutorial!<BR></FONT>

Regards,
mywink2.gif
ldnewbie
 
thanks old!

i was looking for a property of the dynamic textbox like _alpha for example. that way i would just use the setProperty() method. it works great! thanks old. i was expecting something simplier, but this one hits the mark.

again, thanks a lot.


biggie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top