PDA

View Full Version : FMX-html Entities in text field



borispc
September 10th, 2003, 02:38 PM
Hi!
I am dinamically loading and external text from a text file (data.txt) into a text field in flash. That text field reads the external string as html text so I can format the text (face, color, etc) in the text field externally. Easy huh? The problem is that for some reason flash doesn't detect html entities. Example: If flash encounters an ampersand in that external text it doesn't load the rest of the text. If I use the html entity for that character (that is &amp) it doesn't work either.
Any ideas why all the html tags are recognized but not the entities?
thanx.

claudio
September 10th, 2003, 02:41 PM
URL Encoding: Reading special characters from a text file (http://www.macromedia.com/support/flash/ts/documents/url_encoding.htm) <- link

borispc
September 10th, 2003, 02:43 PM
thanx claudio...always so helpful :P

borispc
September 10th, 2003, 02:46 PM
it's strange though...in O'REILLY's Actionsript book says that flash supports the &amp entity in htmlText.
Thanks again.

Voetsjoeba
September 10th, 2003, 02:49 PM
It might be, but Flash reads the vars from the textfile using & as seperator. So when you use & not as seperator you have to URL Encode it, as Claudio said. Then the HTML textfield will display it as & since it is HTML enabled :)

claudio
September 10th, 2003, 03:06 PM
welcome :beam: