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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically change textfield font colour

Status
Not open for further replies.

nicola45

Programmer
Feb 11, 2003
2
GB
I have a flash 4 movie which reads 10 vars from a text
file on startup, and the vars are then assigned assigned to each of ten textfields.

I want to set the font color of each textfield based on the value of the variable assigned to it.

I am not designing for the web, but using Borland CBuilder with the Flash ActiveX control.

Nikki
 
Im sure flash 4 doesnt allows for text colors to be set dynamically.

But a workaround may be to have the choices of color on separate frames and use a set variable command with a go to a frame command that holds the color you
want for that. This could get tricky with multiple text boxes with different colors for each but I think it ought to work.
 
Thanks,

what I've actually done is basically that.

1)2 files, one containing the 10 numbers, one containing ten numbers from 1-3 reflecting the appropriate colour for the textfield.
2)Read both sets of data into vars in the movie
3)for each of the vars, placed 3 transparent textfields, one on top of the other, and each with a different font colour.
The number is assigned to the appropriate textfield based on the colour code 1-3 read from the second file.

The number now appears in the same place, but as the 3 text fields for each number are on top of each other, the only one you see is the one to which the number has been assigned, the other two being empty.

This is clumsy, but it works!


Nikki
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top