Welcome to WebmasterWorld Guest from 18.104.22.168
Forum Moderators: open
i dont really want to strip them out server side as the xml tags will be handy.
also, the same text boxes wont show apostrophes ' - just the square box you get when a characters not availabe.
any ideas how to get round this?
Regarding the ampersands, when flash recieves variables from an outside source, eg. a text file or an echo from php, an ampersand is read as an introduction to a new variable name.
For example if the following was in a text file:
&var1=some text&var2=some other text
Flash thinks it is loading 2 separate variables named var1 and var2.
The only way that I know of to get around this is to use String.fromCharCode(38). Where 38 is the unicode value of an ampersand.
myVar = "some text "
myVar += String.fromCharCode(38);
myVar += " some more text"
Result: some text & some more text
I'm not sure of an easy work around for this problem in your case.
Your other question regarding apostrophes could be simpler.
If you are using an embedded font and that font does not have an apostrophe in it is the first thing that comes to mind.
Now if this were a string written within Flash I would suggest using a backward slash [\] in conjunction with the [']. As the [\] is used before various characters for differing effects.
\n is a new line, \" shows quotes, \t tabs the string.
You could try this method in your echo, but no guarantees as I don't have access to a php server handy atm. I only tested this from a text file and the slashes showed up in the text field .
... so after all this I really don't have an easy answer for you.