Play with nodeValue. As a test add the entity code into the XML file and use
nodeValue:

// XML
<hut_data>
        <title>Akbar &amp; Jeff&apos;s ActionScript Hut</title>
</hut_data>
//
// AS
theClip.txt.text = xmlNode.firstChild.firstChild.nodeValue;
//

instead of:
// XML
<hut_data>
        <title>Akbar & Jeff's ActionScript Hut</title>
</hut_data>
//
// AS
theClip.txt.text = xmlNode.firstChild.firstChild;
//

HTH - Andrew
-----Original Message-----
From: Steven Loe [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 04, 2007 10:24 AM
To: Flashcoders mailing list
Subject: [Flashcoders] Entities are Hell!

I'm loading xml with special characters. These display as their entity codes
i.e. "&" as "&amp;". If I put enitity codes in the xml, I still get entity
codes displaying on screen. What am I doing wrong? Any thoughts? Thanks!!!


Screen Output:
Akbar &amp; Jeff&apos;s ActionScript Hut

my_xml.xml:
<hut_data>
        <title>Akbar & Jeff's ActionScript Hut</title>
</hut_data>


class:
class LoadXml {
        private static var xmlUrl:String = "my_xml.xml";
        private var rootRef;
        private var theClip:MovieClip;
        
        function LoadXml(rootRef) {
                this.rootRef = rootRef;
                var xmlDoc:XML = new XML();
                xmlDoc.ignoreWhite = true;
                xmlDoc.onLoad = function(success:Boolean) {
                        if (success) {
                                this.owner.displayData(this);
                        } else {
                                trace("error loading xml");
                        }
                };
                Object(xmlDoc).owner = this;
                xmlDoc.load(xmlUrl);
        }
        
        private function displayData(xmlDoc:XML) {
                var xmlNode:XMLNode = xmlDoc.firstChild;
                if (xmlNode.nodeName.toString() == "hut_data") {
                        theClip =
this.rootRef.createEmptyMovieClip("theClip", 1);
                        theClip.createTextField("txt", 10, 10, 10, 250, 20);
                        theClip.txt.html = true;
                        theClip.txt.text = xmlNode.firstChild.firstChild;
                }
        }
}




 
____________________________________________________________________________
________
Expecting? Get great news right away with email Auto-Check. 
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html 
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to