How do I get special characters (e.g. ö,ä,ü) from an external .txt file loaded into a dynamic Textfield?

I am loading with the LoadVars object text from an external .txt file into a dynamic text area. The font to be used has been imported into the library, exported for ActionScript and embedded in the text area by setting the embed property to true.  
The external text includes special characters as it is written in German.  These however do not seem to transfer into Flash.  How do I get the special characters of the external text to display correctly in the .swf file?
Who is Participating?
ddlamConnect With a Mentor Commented:
just save the .txt in UTF-8 format
ParlianAuthor Commented:
Unfortunately it did not do the trick as yet, did however change the appearance in the .txt file and I suppose it was one piece of the puzzle missing to bring me closer to the solution.

Another problem I do have with this, is that the text displays in bold, and I cannot get the text formatting to change within Flash.  The source might be the same mistake.


ParlianAuthor Commented:
Here is a sample of the relevant part of the code

      var tfHeading:TextFormat = new TextFormat();
      with (tfHeading) {
            font = "Verdana";
            bold = true;
            color = 0x660000;
            size = 12;
      var tfContent:TextFormat = new TextFormat();
      with (tfContent) {
            font = "Verdana";
            bold = false;
            color = 0x660000;
            size = 12;

      mcComContent.txtHeading.embedFonts = mcComContent.txtContent.embedFonts =true;

      var ComData:LoadVars = new LoadVars();
      ComData.onLoad = function() {
            mcComContent.txtHeading.text = ComData.title1;
            mcComContent.txtContent.text = ComData.content1;
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Aneesh ChopraCommented:
here is my approach,

create a dynamic textField on first frame and keep it out of stage area so that it does not show up when swf runs..
no need to assign instance name..

now, selecte the same font for this txtField which you want to use in other textFields
next step is, select the textField and click embed to open "Character Embedding" dialog.
now enter all special characters in "include these character" textField and click ok

you are done,

now these characters should work fine with all dynamically created textfield also.
ParlianAuthor Commented:
When the text is created within Flash(AS), e.g. self labeling buttons, the special characters display fine with all dynamically created textfields.  
Only, the text which I load from an external file, created with Notepad, still omits the special characters.  

By now I have saved the text file in UTF-8 format, as suggested by ddlam, and added the textField, as suggested by aneeshchopra, unfortunately no special characters to be seen in these fields so far.

Maybe it plays a role that  the whole thing is created with slides, but I would not know why.
Aneesh ChopraCommented:
can you upload your sample source file with external source file for review?
ParlianAuthor Commented:
Hello aneeshchopra

Please find attached the external text file, as well as a copy of the ActionScript, which is allocated to the slide containing the textField movie clip.  I hope this is what you meant. Sorry, I am not quite familiar with the terminologies, as yet, and am not sure what the sample source file is within Flash.

The external Data was only for testing, and length of content1 for testing the scroll component.

Additionally I still do not seem to get rid of the bold  text in the content textField, but am able to manipulate text size and color with the TextFormat object.

Thank you for looking at it

ParlianAuthor Commented:
Hello ddlam and aneeshchopra

I got it working (surprise, surprise) and the solution was with the format of the external .txt file. Thank you ddlam.
I am afraid I cannot say exactly what I did as I was (being very inexperienced)  just playing around with the encoding and converting, to and fro AINSI and UTF-8, until I had the text encoded in UTF-8 format with the special characters not showing as E4s or something similar.

Thank you for your support
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.