[Flashcoders] AS3/E4X Problems porting from AS2

2008-04-16 Thread Jer Brand
I'm in the process of switching some of my apps over to AS3, with one class used to access and XML object giving me a fits. The class is used to navigate through a serious of pages, with the XML acting like the table of contents (chapter/topic/page). Applications using this class would make calls

Re: [Flashcoders] AS3/E4X Problems porting from AS2

2008-04-16 Thread Peter Hall
When porting from AS2, you might find it more direct to use XMLDocument instead of XML. This behaves exactly like the AS2 XML object. Having said that, I tried your code and it seemed to work (I assumed where you put node.childIndex() it was a typo and you meant to write

Re: [Flashcoders] AS3/E4X Problems porting from AS2

2008-04-16 Thread Jer Brand
yeah, typo (copied code without changing the names to make any sense in the context of this post). If that code is working, I may have a more subtle bug working somewhere...I'm going to guess that it may be from running a filter and setting the XMLList directly to an XML object -- Either way,

Re: [Flashcoders] AS3/E4X Problems porting from AS2

2008-04-16 Thread Jer Brand
And the problem becomes obvious... once I think about it. AS2's to attempt to execute code on a variable containing null was used over and over to determine when I reached the end of a set of pages in a particular topic. Code like switch(node.nodeName) ... case undefined: Happily executes