Hi, I ran into the exact same problem about a year ago... The XML class doesn't really make it easy to extend... The way I solved it is by overriding all necessary methods of the XML class with methods in my extended version, so EXML in your case. E.g.
function someOverridenMethod():EXML { // do some other stuff .... return new EXML( this.cloneNode(true).toString() ); } That way all instances of XMLNode are converted to EXML before being returned. This could of course also be used for newly added methods in your extended class... Hope that helps. Jan On 1/4/06, Rifled Cloaca <[EMAIL PROTECTED]> wrote: > > Hi! > > I'm new to AS2, and I'm trying to convert some old AS1 code to AS2. This > code uses XML.prototype to add functionality to the XML class (which is > based on the XMLNode class, but you knew that already). I'm creating a > new > class like this: > > dynamic class core.EXML extends XML { > } > > This new XML class has new properties in each of its nodes, so I add: > > > dynamic class core.EXML extends XML { > > public var _MC:MovieClip; > public var _parentMC:MovieClip; > > } > > But, unfortunately, since the EXML class inherits from the XML class, the > nodes are of XMLNode class, not EXML class, so the nodes do not inherit > the > properties and methods I create in the new EXML class. > > So, my question is, how do I create a class that creates instances of > itself, or say, an EXMLNode class that inherits from XMLNode? > > Any help is greatly appreciated. Thanks! > > -rc > _______________________________________________ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders