Displaying the apostrophe ‘ symbol, loaded from an XML file.
Displaying the apostrophe ‘ symbol, loaded from an XML file where a fieldfield is loaded dynamically with Action Script.
Adapted from a flashcoders post.
1. Firstly, the apostrophe within the xml is written as ' within the correct tags. Eg:
< mainText >2. Assume there is a function called replaceText which creates a string from the XML file, within the ActionScript.The twins' information... < /mainText >
newText = replaceText(newText);3. Set the string of the asset on the stage via a function called fixApostrophes:
tmpCurrentPage.alert.text = fixApostrophes(newText);4. The fixApostrophes function:
function fixApostrophes(theHeaderText){5. That's it!
theHeaderString = String(theHeaderText);if(theHeaderText.indexOf("'") != -1) {return theHeaderText;
theHeaderArray = theHeaderString.split("'");
theHeaderText = theHeaderArray.join("\'");
}
}

0 Comments:
Post a Comment
<< Home