RE: [flexcoders] Stack overflow
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.
Re: [flexcoders] Stack Overflow in swf to swf include
Thanks Pete. Adding makeObjectsBinadble=false solved the problem. Yes, the service returns a simple XML generated from a cfm file. userPrefdevicephone/device/userPref I'm curious to know how this is related to the stack overflow. Does makeObjectsBinadble=false restrict any functionality ? - since i need the included swf to communicate with the loader swf and also with the hosting HTML page (via some callbackjs fns). -Joseph On 10/18/06, Peter Farland [EMAIL PROTECTED] wrote: I could reproduce your problem- I'll log a bug on your behalf. Out of curiosity, does your HTTPService return XML? If so, any chance you could show us what the XML looks like? As a work around for now you could either set makeObjectsBinadble=false on your HTTPService tag or set resultFormat=e4x or resultFormat=text (instead of the default, which is object). Thanks, Pete From: [EMAIL PROTECTED]ups.com [mailto: flexcoders@yahoogroups.com] On Behalf Of Flex LearnerSent: Tuesday, October 17, 2006 2:45 PMTo: [EMAIL PROTECTED] ups.comSubject: [flexcoders] Stack Overflow in swf to swf include HI, I'm trying to include an swf file (generated from FlexBuilder) within another swf file using mx:image. The included file is located on a different server, and the include works fine. Now, if a HTTPService is added to the included file, the call fails with the following exception. Error: Error #1023: Stack overflow occurred.at Object$/Object::_hasOwnProperty()at Object/http://adobe.com/AS3/2006/builtin::hasOwnProperty()at Object$/Object::_hasOwnProperty().at Object$/Object::_hasOwnProperty() is repeated many times. It appears like an infinite loop that's triggered internally and terminates with a stack overflow. The mxml for the caller swf (located on www.abc.com) is as follows : == ?xml version=1.0 encoding=utf-8?mx:Application xmlns:mx=http://www.adobe.com/2006/mxml layout=horizontal mx:Script![CDATA[import flash.system.Security; Security.allowDomain(www.xyz.com); ]]/mx:Scriptmx:Image source=http://www.xyz.com/test/Loadee.swf x=300 y=350 showBusyCursor=true/ /mx:Application mxml for the called swf (Loadee.swf) == ?xml version=1.0 encoding=utf-8?mx:Application xmlns:mx=http://www.adobe.com/2006/mxml layout=horizontal width=270 height=54 creationComplete= getState.send();mx:Text text=Initial Text x=300 y=300 id=thisText/ mx:HTTPService url="" href="http://www.xyz.com/ServersideScript.do" target="_blank">http://www.xyz.com/ServersideScript.do id=getState result=chgState()/ mx:Script![CDATA[function chgState() {// ideally do something with the HTTP response here,thisText.text= HTTP call succeeded;}]]/mx:Script /mx:Application Any inputs here will be greatly helpful. Thanks, Joseph __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Software development tool Software development Software development services Home design software Software development company Your email settings: Individual Email|Traditional Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___
RE: [flexcoders] Stack Overflow in swf to swf include
It does restrict some functionality... to describe what's happening in HTTPService - an underlyingURLLoader returns your XML data as a String. This String is then turned into XML and then if the resultFormat is left as the default setting of "object" it will convert this XML into an ActionScript Object graph. If makeObjectsBindable is false thenObjects will not be wrapped by mx.utils.ObjectProxy and Arrays will not be wrapped by mx.collections.ArrayCollection and as such property change events will not be dispatched when the object graph is modified, which will mean if the data is used as a data provider to a UI component it won't reflect changes as the data is modified. Another workaround for now is to do the decoding yourself. You could either change the resultFormat attribute to E4X and then process the XML structure into a tree of objects or specify a Function for the xmlDecode property. Some code to demonstrate the general idea is below: import mx.collections.ArrayCollection; import mx.utils.ObjectProxy; ... private function decode(data:XML):Object { var result:Object; if (data.elements().length() == 0) { result = data.text().toXMLString(); } else { result = {}; result = new ObjectProxy(result); var elements:XMLList = data.elements(); for each (var x:XML in elements) { var part:Object = decode(x); var name:String = x.localName(); var existing:Object = result[name]; if (existing != null) { if (existing is ArrayCollection) ArrayCollection(existing).addItem(part); else { var temp:ArrayCollection = new ArrayCollection(); temp.addItem(existing); temp.addItem(part); result[name] = temp; } } else { result[name] = part; } } } return result; } From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Flex LearnerSent: Wednesday, October 18, 2006 2:25 AMTo: flexcoders@yahoogroups.comSubject: Re: [flexcoders] Stack Overflow in swf to swf include Thanks Pete. Adding makeObjectsBinadble="false" solved the problem. Yes, the service returns a simple XML generated from a cfm file. userPrefdevicephone/device/userPref I'm curious to know how this is related to the stack overflow. Does makeObjectsBinadble="false" restrict any functionality ? - since i need the included swf to communicate with the loader swf and also with the hosting HTML page (via some callbackjs fns). -Joseph On 10/18/06, Peter Farland [EMAIL PROTECTED]com wrote: I could reproduce your problem- I'll log a bug on your behalf. Out of curiosity, does your HTTPService return XML? If so, any chance you could show us what the XML looks like? As a work around for now you could either set makeObjectsBinadble="false" on your HTTPService tag or set resultFormat="e4x" or resultFormat="text" (instead of the default, which is "object"). Thanks, Pete From: [EMAIL PROTECTED]ups.com [mailto: flexcoders@yahoogroups.com] On Behalf Of Flex LearnerSent: Tuesday, October 17, 2006 2:45 PMTo: [EMAIL PROTECTED] ups.comSubject: [flexcoders] Stack Overflow in swf to swf include HI, I'm trying to include an swf file (generated from FlexBuilder) within another swf file using mx:image. The included file is located on a different server, and the include works fine. Now, if a HTTPService is added to the included file, the call fails with the following exception. Error: Error #1023: Stack overflow occurred.at Object$/Object::_hasOwnProperty()at Object/http://adobe.com/AS3/2006/builtin::hasOwnProperty()at Object$/Object::_hasOwnProperty().at Object$/Object::_hasOwnProperty() is repeated many times. It appears like an infinite loop that's triggered internally and terminates with a stack overflow. The mxml for the caller swf (located on www.abc.com) is as follows : == ?xml version="1.0" encoding="utf-8"?mx:Application xmlns:mx="http://www.adobe.com/2006/mxml " layout="horizontal" mx:Script![CDATA[import flash.system.Security; Security.allowDomain("www.xyz.com"); ]]/mx:Scriptmx:Image source="http://www.xyz.com/test/Loadee.swf " x="300" y="350" showBusyCursor="true"/ /mx:Application mxml for the called swf (Loadee.swf) == ?xml version="1.0" encoding="utf-8"?mx:Application xmlns:mx="http://www.adobe.com/2006/mxml " layout="horizontal" width="270" height="54" creationComplete=" getState.send();"mx:Text text="Initial Text" x="300" y="300" id="thisText"/ mx:HTTPService url=""http://www.xyz.com/ServersideScript.do" target=_blank>http://www.xy
RE: [flexcoders] Stack Overflow in swf to swf include
Hmm, on testing this code in your scenario I realized I can reproduce the issue again that you described. It seems related to ObjectProxy's use of the intrinsic Proxy class from ActionScript. If you could avoid checking for existing properties and develop another way to detect what needs to be an Array then you can avoid the bug... otherwise you will need to avoid the use of ObjectProxy in this scenario for now. Note the bug that was filed was 188654 if you need to refer to it in the future. Pete From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Peter FarlandSent: Wednesday, October 18, 2006 9:51 AMTo: flexcoders@yahoogroups.comSubject: RE: [flexcoders] Stack Overflow in swf to swf include It does restrict some functionality... to describe what's happening in HTTPService - an underlyingURLLoader returns your XML data as a String. This String is then turned into XML and then if the resultFormat is left as the default setting of "object" it will convert this XML into an ActionScript Object graph. If makeObjectsBindable is false thenObjects will not be wrapped by mx.utils.ObjectProxy and Arrays will not be wrapped by mx.collections.ArrayCollection and as such property change events will not be dispatched when the object graph is modified, which will mean if the data is used as a data provider to a UI component it won't reflect changes as the data is modified. Another workaround for now is to do the decoding yourself. You could either change the resultFormat attribute to E4X and then process the XML structure into a tree of objects or specify a Function for the xmlDecode property. Some code to demonstrate the general idea is below: import mx.collections.ArrayCollection; import mx.utils.ObjectProxy; ... private function decode(data:XML):Object { var result:Object; if (data.elements().length() == 0) { result = data.text().toXMLString(); } else { result = {}; result = new ObjectProxy(result); var elements:XMLList = data.elements(); for each (var x:XML in elements) { var part:Object = decode(x); var name:String = x.localName(); var existing:Object = result[name]; if (existing != null) { if (existing is ArrayCollection) ArrayCollection(existing).addItem(part); else { var temp:ArrayCollection = new ArrayCollection(); temp.addItem(existing); temp.addItem(part); result[name] = temp; } } else { result[name] = part; } } } return result; } From: [EMAIL PROTECTED]ups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Flex LearnerSent: Wednesday, October 18, 2006 2:25 AMTo: [EMAIL PROTECTED]ups.comSubject: Re: [flexcoders] Stack Overflow in swf to swf include Thanks Pete. Adding makeObjectsBinadble="false" solved the problem. Yes, the service returns a simple XML generated from a cfm file. userPrefdevicephone/device/userPref I'm curious to know how this is related to the stack overflow. Does makeObjectsBinadble="false" restrict any functionality ? - since i need the included swf to communicate with the loader swf and also with the hosting HTML page (via some callbackjs fns). -Joseph On 10/18/06, Peter Farland [EMAIL PROTECTED]com wrote: I could reproduce your problem- I'll log a bug on your behalf. Out of curiosity, does your HTTPService return XML? If so, any chance you could show us what the XML looks like? As a work around for now you could either set makeObjectsBinadble="false" on your HTTPService tag or set resultFormat="e4x" or resultFormat="text" (instead of the default, which is "object"). Thanks, Pete From: [EMAIL PROTECTED]ups.com [mailto: flexcoders@yahoogroups.com] On Behalf Of Flex LearnerSent: Tuesday, October 17, 2006 2:45 PMTo: [EMAIL PROTECTED] ups.comSubject: [flexcoders] Stack Overflow in swf to swf include HI, I'm trying to include an swf file (generated from FlexBuilder) within another swf file using mx:image. The included file is located on a different server, and the include works fine. Now, if a HTTPService is added to the included file, the call fails with the following exception. Error: Error #1023: Stack overflow occurred.at Object$/Object::_hasOwnProperty()at Object/http://adobe.com/AS3/2006/builtin::hasOwnProperty()at Object$/Object::_hasOwnProperty().at Object$/Object::_hasOwnProperty() is repeated many times. It appears like an infinite loop that's triggered internally and terminates with a stack overflow. The mxml for the caller swf (located on www.abc.com) is as follows : == ?xml version="1.0" encoding="utf-8"?mx:Application xmlns:mx="http://www.adobe.com/2006/mxml " layout="horizontal" mx:Script![CDATA[import flash.system.Security; Security.all
RE: [flexcoders] Stack Overflow in swf to swf include
I could reproduce your problem- I'll log a bug on your behalf. Out of curiosity, does your HTTPService return XML? If so, any chance you could show us what the XML looks like? As a work around for now you could either set makeObjectsBinadble="false" on your HTTPService tag or set resultFormat="e4x" or resultFormat="text" (instead of the default, which is "object"). Thanks, Pete From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Flex LearnerSent: Tuesday, October 17, 2006 2:45 PMTo: flexcoders@yahoogroups.comSubject: [flexcoders] Stack Overflow in swf to swf include HI, I'm trying to include an swf file (generated from FlexBuilder) within another swf file using mx:image. The included file is located on a different server, and the include works fine. Now, if a HTTPService is added to the included file, the call fails with the following exception. Error: Error #1023: Stack overflow occurred.at Object$/Object::_hasOwnProperty()at Object/http://adobe.com/AS3/2006/builtin::hasOwnProperty()at Object$/Object::_hasOwnProperty().at Object$/Object::_hasOwnProperty() is repeated many times. It appears like an infinite loop that's triggered internally and terminates with a stack overflow. The mxml for the caller swf (located on www.abc.com) is as follows : == ?xml version="1.0" encoding="utf-8"?mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" mx:Script![CDATA[import flash.system.Security; Security.allowDomain("www.xyz.com"); ]]/mx:Scriptmx:Image source="http://www.xyz.com/test/Loadee.swf" x="300" y="350" showBusyCursor="true"/ /mx:Application mxml for the called swf (Loadee.swf) == ?xml version="1.0" encoding="utf-8"?mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" width="270" height="54" creationComplete=" getState.send();"mx:Text text="Initial Text" x="300" y="300" id="thisText"/mx:HTTPService url=""http://www.xyz.com/ServersideScript.do">http://www.xyz.com/ServersideScript.do " id="getState" result="chgState()"/mx:Script![CDATA[function chgState() {// ideally do something with the HTTP response here,thisText.text= "HTTP call succeeded";}]]/mx:Script /mx:Application Any inputs here will be greatly helpful. Thanks, Joseph __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Software development tool Software development Software development services Home design software Software development company Your email settings: Individual Email|Traditional Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___