This content has been marked as final. Show 3 replies
Are you assigning text via TextField.text or TextField.htmlText? If you aren't using htmlText, use that.
Also, trace the XML data after its loaded, see if the greek beta is getting converted to an entity, like β. It probably is. In that case, I don't think htmlText will properly convert it, and you will have to do it yourself, like this:
myText.htmlText = myLoadedText.split('β').join('β');
I often make a function which cleans up entities(like above) that I'll be using in the project.
Thanks - I seem to be following you though process, but can't seem to get it to work. I am using .html text and you were spot on with the β conversion.
Am I correct that the split should cut out the β in the text and replace it with the β. I have not got it to work quite right. I have my text pushed into an array based on combo boxes the user selects. I then populate the field by looping through the array. Should the split - join work when looping through the array, or should I put the array info in a string "holder" and then try the split - join.
Thanks again for the help and direction. I'll keep trying some different approaches over the weekend.
You are correct about split().join(). String.split() will split the text into an Array of elements, cut up at all instances of the passs ed in character. Array.join() will merge all elements as an array into a String, placing a dilimiter of choice. By doing split().join() it's effectively a find and replace. You could even do this:
myString = myString.split().join().split().join().split().join();
And pass in as many find.replace pairs as you want.
If I follow your set up, you should be able to use split().join() at any point. For instance:
myTextField_txt.htmlText = myArray[index].split('β').join('β');
You say its not working. What isn't working about it? ie is there character not showing up at all? Is it showing up as a box? is it showing up as β ? Make sure you are using a font which has the β symbol, like Arial.
Depending on how much you need to convert text in this way, you might want to consider making a function, like this:
Then you could just do, using the earlier example:
myTextField_txt.htmlText = convertEntities(myArray[index]);
anotherTextField_txt.htmlText = convertEntities(myArray[index2]);