<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>
<channel>
	<title>Comments on: XMLAsset: API for embedded XML files</title>
	<atom:link href="http://www.ericfeminella.com/blog/2008/07/27/xmlasset-api/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ericfeminella.com/blog/2008/07/27/xmlasset-api/</link>
	<description></description>
	<pubDate>Sat, 13 Mar 2010 14:43:06 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Erik</title>
		<link>http://www.ericfeminella.com/blog/2008/07/27/xmlasset-api/comment-page-1/#comment-81775</link>
		<dc:creator>Erik</dc:creator>
		<pubDate>Mon, 28 Jul 2008 09:12:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.ericfeminella.com/blog/2008/07/27/xmlasset-api/#comment-81775</guid>
		<description>There is another way. This requires a bit different implementation of XMLAsset. From the top of my head:

package com.ericfeminella.xml.XMLAsset
{
    import flash.utils.ByteArray;
    
    public class XMLAsset extends ByteArray
    {
        private var _xml:XML;

        public function get xml():XML
        {
             if (!_xml)
             {
                 position = 0;
                 _xml = new XML(readUTFBytes(bytesAvailable));
             }
             return _xml;
        }
    }

}


package
{
    import com.ericfeminella.xml.XMLAsset;

    [Embed("config.xml", mimeType="application/octet-stream")]
    public class Config extends XMLAsset
    {
    }
}

var config:Config = new Config();
trace( config.xml.toXMLString() );


Greetz Erik</description>
		<content:encoded><![CDATA[<p>There is another way. This requires a bit different implementation of XMLAsset. From the top of my head:</p>
<p>package com.ericfeminella.xml.XMLAsset<br />
{<br />
    import flash.utils.ByteArray;</p>
<p>    public class XMLAsset extends ByteArray<br />
    {<br />
        private var _xml:XML;</p>
<p>        public function get xml():XML<br />
        {<br />
             if (!_xml)<br />
             {<br />
                 position = 0;<br />
                 _xml = new XML(readUTFBytes(bytesAvailable));<br />
             }<br />
             return _xml;<br />
        }<br />
    }</p>
<p>}</p>
<p>package<br />
{<br />
    import com.ericfeminella.xml.XMLAsset;</p>
<p>    [Embed("config.xml", mimeType="application/octet-stream")]<br />
    public class Config extends XMLAsset<br />
    {<br />
    }<br />
}</p>
<p>var config:Config = new Config();<br />
trace( config.xml.toXMLString() );</p>
<p>Greetz Erik</p>
]]></content:encoded>
	</item>
</channel>
</rss>
