having problem insertchildbefore insertchildafter as3


i have an xml document:



var xml:xml = new xml(<rootnode>            
<head>
<meta name="template" content="default" />
</head>
<mainsection>
<itemlist>
<item>
<video src={this.videourl} />
<img src={this.src}></img>
</item>
</itemlist>
</mainsection>
</rootnode>);


what i'd do, certain conditions me, insert another during commencement itemlist.



var newnode:xmllist = new xmllist("<item><video src=\"" + _videosource + "\"></video></item>");


i'm means beget snippet newnode only fine, nonetheless whenever i try supplement controlling insertchildbefore, always advantage undefined.



var contentnode:xml = new xml(xml.mainsection.itemlist.item);
xml.insertchildbefore(contentnode ,newnode)


contentnode always traces fine, nonetheless always fails perplexing insertchildbefore insertchildafter. uncanny thing is, i contentnode reduction specific (like xml.mainsection) following works expected.



thanks any help, pulling me insane!



Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

why does floated <input> control floated component slip over too distant right ie7, nonetheless firefox?