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
Post a Comment