Hello, I've created a flash movie which loads texts from a textfile into a dynamic textbox to be displayed. However, in my text I have a "%" sign, which is not being rendered when am loading the text in the flash. Anyone knows how to make this show up? Am using flash cs5, but saving my project in cs4 format, with flash 8 player support

PS. I did save my text file with UTF-8

Dani AI

Generated

As discovered, the missing percent sign is not a font or encoding bug in the text field — it happens because Flash is parsing the loaded file as URL-encoded name/value data (the kind of format used by LoadVars/URLVariables). In that mode a % starts a percent-escape sequence, so an unencoded % gets dropped or misinterpreted by the parser, which is why your trace and textfield both showed it missing while a ? (not special in that context) survived.

Practical fixes:

  • If you keep the file as variable-style data, URL-encode special characters in the file (a percent sign becomes %25; spaces and other symbols must be encoded too). The loader will decode them back into normal characters.
  • If you want to avoid encoding, load the file as raw text instead of parsed variables. In AS3 that means using a URLLoader with dataFormat = URLLoaderDataFormat.TEXT (so you get the literal string to assign to the text field). On the Flash side you can also decode encoded sequences with appropriate decode functions if needed.
  • Quick troubleshooting: verify the loader/API being used (variable parser vs plain text) and ensure the source file is saved without a UTF-8 BOM if targeting older Flash/AS2 players, since BOMs can introduce unexpected leading characters.

Checklist: decide whether to treat the file as form-data or raw text, then either URL-encode special chars (e.g. %%25) or switch to a raw-text loader. This explains the behavior you traced.

I did a trace with the code, but from there itself it discards the % sign, while I did add a ? sign to test, and this one is loaded correctly. any idea why am not able to display the % sign?

here is my content available from the text file:

&varEn=Discount of 10 % on any flight booked today?

from the above, I added the ? sign to test and it was displayed in the trace, and in my dynamic textbox as well, except for the % sign

Finally found out that I had to use URL Encoding codes in the text file itself to be able to display properly in the flash afterwards

list of codes

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.