You are mixing up the XML implementation versions.
XMLDocument and simpleDecoder are legacy AS2 classes, included in AS3 only for backwards compatibility. You cannot use them with XML() which is an e4x implementation. Tracy Spratt, Lariat Services, development services available _____ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of markgoldin_2000 Sent: Monday, April 20, 2009 4:21 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Stack overflow I am getting the following: Error: Error #1023: Stack overflow occurred. at flash.xml::XMLNode() at flash.xml::XMLDocument/createElement() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() at mx.rpc.xml::SimpleXMLEncoder/encodeValue() In this function after the 4th line: public function objectToXML(obj:Object):XML { var qName:QName = new QName("root"); var xmlDocument:XMLDocument = new XMLDocument(); var simpleXMLEncoder:SimpleXMLEncoder = new SimpleXMLEncoder(xmlDocument); var xmlNode:XMLNode = simpleXMLEncoder.encodeValue(obj, qName, xmlDocument); var xml:XML = new XML(xmlDocument.toString()); return xml; } Interesting that it works once, but second call to this function generates the error. Thanks for help.