<?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/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
	>
<channel>
	<title>Comments on: Embed Almost Anything in Your SWF</title>
	<atom:link href="http://dispatchevent.org/roger/embed-almost-anything-in-your-swf/feed/" rel="self" type="application/rss+xml" />
	<link>http://dispatchevent.org/roger/embed-almost-anything-in-your-swf/</link>
	<description>Collective thoughts of the New York Flash community</description>
	<lastBuildDate>Sat, 04 Jul 2009 20:08:45 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Chris</title>
		<link>http://dispatchevent.org/roger/embed-almost-anything-in-your-swf/comment-page-1/#comment-146460</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Fri, 01 May 2009 14:36:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/embed-almost-anything-in-your-swf#comment-146460</guid>
		<description>Great post! The Adobe live docs list the acceptable mime-types used for transcoding, and text/xml is not among them. I&#039;ve been using this technique (with octet-stream) for a while to compress xml documents for lighter deployment (I&#039;m sure you&#039;ve noticed that the xml file size shrinks by about 75% when using the embed technique. ) If XML is included as a literal in the code, rather than being embedded with the [Embed] directive, you get close to 90% compression (120kb xml files drop to circa 12kb as swfs!). I&#039;m thinking about developing an app that dynamically builds an actionscript file from a source xml doc, that can then be compiled with ant... to semi-automate the process for clients with lots of xml docs. Definitely an under-documented, but cool, affordance!</description>
		<content:encoded><![CDATA[<p>Great post! The Adobe live docs list the acceptable mime-types used for transcoding, and text/xml is not among them. I&#8217;ve been using this technique (with octet-stream) for a while to compress xml documents for lighter deployment (I&#8217;m sure you&#8217;ve noticed that the xml file size shrinks by about 75% when using the embed technique. ) If XML is included as a literal in the code, rather than being embedded with the [Embed] directive, you get close to 90% compression (120kb xml files drop to circa 12kb as swfs!). I&#8217;m thinking about developing an app that dynamically builds an actionscript file from a source xml doc, that can then be compiled with ant&#8230; to semi-automate the process for clients with lots of xml docs. Definitely an under-documented, but cool, affordance!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Wabyick</title>
		<link>http://dispatchevent.org/roger/embed-almost-anything-in-your-swf/comment-page-1/#comment-140143</link>
		<dc:creator>Daniel Wabyick</dc:creator>
		<pubDate>Sat, 28 Feb 2009 16:21:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/embed-almost-anything-in-your-swf#comment-140143</guid>
		<description>I noticed that any XML with a doctype declaration screws up the encoder with text/XML.  Like the following ...



Removing that works, or else, Application/Octet-stream seems to work really well.</description>
		<content:encoded><![CDATA[<p>I noticed that any XML with a doctype declaration screws up the encoder with text/XML.  Like the following &#8230;</p>
<p>Removing that works, or else, Application/Octet-stream seems to work really well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Murray</title>
		<link>http://dispatchevent.org/roger/embed-almost-anything-in-your-swf/comment-page-1/#comment-138143</link>
		<dc:creator>Murray</dc:creator>
		<pubDate>Fri, 13 Feb 2009 10:35:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/embed-almost-anything-in-your-swf#comment-138143</guid>
		<description>In my experience, specifying text/xml doesn&#039;t make a difference. Flash will create an object class, with data and prototype. The xml you want is in the data fork. So your first bit of code would be:

[Embed(source = &quot;test.xml&quot;)]
var EmbeddedXML:Class;
var myXML:Object = EmbeddedXML.data;
// process your xml - the data object behaves as xml allowing the same methods
var myvar:String = myXML.noderef.toString(); // replace noderef with target node

It&#039;s buggy with reading in XML, the first line has to be a node - not a comment or a doctype declaration.</description>
		<content:encoded><![CDATA[<p>In my experience, specifying text/xml doesn&#8217;t make a difference. Flash will create an object class, with data and prototype. The xml you want is in the data fork. So your first bit of code would be:</p>
<p>[Embed(source = "test.xml")]<br />
var EmbeddedXML:Class;<br />
var myXML:Object = EmbeddedXML.data;<br />
// process your xml &#8211; the data object behaves as xml allowing the same methods<br />
var myvar:String = myXML.noderef.toString(); // replace noderef with target node</p>
<p>It&#8217;s buggy with reading in XML, the first line has to be a node &#8211; not a comment or a doctype declaration.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roger Braunstein</title>
		<link>http://dispatchevent.org/roger/embed-almost-anything-in-your-swf/comment-page-1/#comment-130643</link>
		<dc:creator>Roger Braunstein</dc:creator>
		<pubDate>Wed, 12 Nov 2008 22:06:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/embed-almost-anything-in-your-swf#comment-130643</guid>
		<description>Hey everyone,

Yes, I&#039;ve had problems getting this to work with text/xml continuously as well. I swear, though, it did work once. Then I wrote this. Then it promptly broke. I assert that with noodling you can get it to work with text/xml (I swear it did!) but I&#039;ve been using application/octet-stream ever since. Sorry for the misinformation!</description>
		<content:encoded><![CDATA[<p>Hey everyone,</p>
<p>Yes, I&#8217;ve had problems getting this to work with text/xml continuously as well. I swear, though, it did work once. Then I wrote this. Then it promptly broke. I assert that with noodling you can get it to work with text/xml (I swear it did!) but I&#8217;ve been using application/octet-stream ever since. Sorry for the misinformation!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://dispatchevent.org/roger/embed-almost-anything-in-your-swf/comment-page-1/#comment-126805</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Wed, 24 Sep 2008 03:05:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/embed-almost-anything-in-your-swf#comment-126805</guid>
		<description>yeah u gotta use:
mimeType=&quot;application/octet-stream&quot;)]

not text/xml 

.... :/</description>
		<content:encoded><![CDATA[<p>yeah u gotta use:<br />
mimeType=&#8221;application/octet-stream&#8221;)]</p>
<p>not text/xml </p>
<p>&#8230;. :/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://dispatchevent.org/roger/embed-almost-anything-in-your-swf/comment-page-1/#comment-118809</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Mon, 30 Jun 2008 18:11:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/embed-almost-anything-in-your-swf#comment-118809</guid>
		<description>Actually, this works just fine here (Flex Builder 3)

	[Embed(source=&quot;/../xml/TacticalMaps.xml&quot;,mimeType=&quot;application/octet-stream&quot;)]
		protected const EmbeddedXML:Class;
		
		
		public function LoadMapXML():void
		{
			var x:XML = XML(new EmbeddedXML());
trace(x.toXMLString());
			
			for each (var map:XML in x.maps)
			{
				var tmd:TacticalMapData = new TacticalMapData(map);
				
				maps[map.@name] = tmd;
			}</description>
		<content:encoded><![CDATA[<p>Actually, this works just fine here (Flex Builder 3)</p>
<p>	[Embed(source="/../xml/TacticalMaps.xml",mimeType="application/octet-stream")]<br />
		protected const EmbeddedXML:Class;</p>
<p>		public function LoadMapXML():void<br />
		{<br />
			var x:XML = XML(new EmbeddedXML());<br />
trace(x.toXMLString());</p>
<p>			for each (var map:XML in x.maps)<br />
			{<br />
				var tmd:TacticalMapData = new TacticalMapData(map);</p>
<p>				maps[map.@name] = tmd;<br />
			}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rudestar</title>
		<link>http://dispatchevent.org/roger/embed-almost-anything-in-your-swf/comment-page-1/#comment-104907</link>
		<dc:creator>rudestar</dc:creator>
		<pubDate>Thu, 17 Apr 2008 14:18:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/embed-almost-anything-in-your-swf#comment-104907</guid>
		<description>PS. Thanks Dan. http://www.dan-hunter.net</description>
		<content:encoded><![CDATA[<p>PS. Thanks Dan. <a href="http://www.dan-hunter.net" rel="nofollow">http://www.dan-hunter.net</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rudestar</title>
		<link>http://dispatchevent.org/roger/embed-almost-anything-in-your-swf/comment-page-1/#comment-104904</link>
		<dc:creator>rudestar</dc:creator>
		<pubDate>Thu, 17 Apr 2008 14:17:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/embed-almost-anything-in-your-swf#comment-104904</guid>
		<description>looks like a bug in the transcoder perhaps or the relevant transcoder is unavailable for an Actionscript project this seems to work:

&lt;code&gt;
package
{
	import flash.display.MovieClip;
	import flash.utils.ByteArray;
	
	public class Test extends MovieClip
	{
		[Embed(source=&quot;data.xml&quot;, mimeType=&quot;application/octet-stream&quot;)]
	    private static const MyData:Class;
	
	    public function Test():void{
		    var byteArray:ByteArray = new MyData() as ByteArray;
		    var xml:XML = new XML(byteArray.readUTFBytes(byteArray.length));
		    trace(xml.toXMLString());
	    }
	}
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>looks like a bug in the transcoder perhaps or the relevant transcoder is unavailable for an Actionscript project this seems to work:</p>
<p><code><br />
package<br />
{<br />
	import flash.display.MovieClip;<br />
	import flash.utils.ByteArray;</p>
<p>	public class Test extends MovieClip<br />
	{<br />
		[Embed(source="data.xml", mimeType="application/octet-stream")]<br />
	    private static const MyData:Class;</p>
<p>	    public function Test():void{<br />
		    var byteArray:ByteArray = new MyData() as ByteArray;<br />
		    var xml:XML = new XML(byteArray.readUTFBytes(byteArray.length));<br />
		    trace(xml.toXMLString());<br />
	    }<br />
	}<br />
}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rudestar</title>
		<link>http://dispatchevent.org/roger/embed-almost-anything-in-your-swf/comment-page-1/#comment-104903</link>
		<dc:creator>rudestar</dc:creator>
		<pubDate>Thu, 17 Apr 2008 14:11:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/embed-almost-anything-in-your-swf#comment-104903</guid>
		<description>yeah I have to concurr this example does not seem to work or at least not in FB2.01 as an Actionscript project. Real shame as I am going nuts trying to embed XML too sensitive to load remotely. Do we have to set compiler properties or compile outside of flex builder using mxmlc to get this to work? Or will the XML parser only work within a Flex project?</description>
		<content:encoded><![CDATA[<p>yeah I have to concurr this example does not seem to work or at least not in FB2.01 as an Actionscript project. Real shame as I am going nuts trying to embed XML too sensitive to load remotely. Do we have to set compiler properties or compile outside of flex builder using mxmlc to get this to work? Or will the XML parser only work within a Flex project?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Y</title>
		<link>http://dispatchevent.org/roger/embed-almost-anything-in-your-swf/comment-page-1/#comment-99866</link>
		<dc:creator>Y</dc:creator>
		<pubDate>Fri, 04 Apr 2008 14:01:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/embed-almost-anything-in-your-swf#comment-99866</guid>
		<description>Hi Roger,

I am trying to embed an SWF created in Flash (CS3). After embedding it I want to access a parameter from it (a:String).

I am not able to do it. 

[Embed(source=&quot;3.swf&quot;)]
private const SWFAsset:Class;

and using it as 

var swfMovie:MovieClip = new SWFAsset() as MovieClip;

now I want to access a variable &quot;a&quot; from the movie clip.

tried trace(&quot;Val &quot; + swfMovie[&#039;a&#039;].toString());

Any ideas??</description>
		<content:encoded><![CDATA[<p>Hi Roger,</p>
<p>I am trying to embed an SWF created in Flash (CS3). After embedding it I want to access a parameter from it (a:String).</p>
<p>I am not able to do it. </p>
<p>[Embed(source="3.swf")]<br />
private const SWFAsset:Class;</p>
<p>and using it as </p>
<p>var swfMovie:MovieClip = new SWFAsset() as MovieClip;</p>
<p>now I want to access a variable &#8220;a&#8221; from the movie clip.</p>
<p>tried trace(&#8221;Val &#8221; + swfMovie['a'].toString());</p>
<p>Any ideas??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roger Braunstein</title>
		<link>http://dispatchevent.org/roger/embed-almost-anything-in-your-swf/comment-page-1/#comment-61406</link>
		<dc:creator>Roger Braunstein</dc:creator>
		<pubDate>Mon, 03 Dec 2007 15:50:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/embed-almost-anything-in-your-swf#comment-61406</guid>
		<description>&lt;a href=&quot;#comment-61169&quot; rel=&quot;nofollow&quot;&gt;@Eli&lt;/a&gt;, I&#039;m not sure you will have success playing back embedded FLVs, since the &lt;tt&gt;NetStream&lt;/tt&gt; object seems to only want to load FLVs from remote locations... The one way I thought might work, though not exactly what you want, is to compress the videos as SWFs instead of FLVs, and then embed them and display with &lt;tt&gt;Loader.loadBytes()&lt;/tt&gt;.</description>
		<content:encoded><![CDATA[<p><a href="#comment-61169" rel="nofollow">@Eli</a>, I&#8217;m not sure you will have success playing back embedded FLVs, since the <tt>NetStream</tt> object seems to only want to load FLVs from remote locations&#8230; The one way I thought might work, though not exactly what you want, is to compress the videos as SWFs instead of FLVs, and then embed them and display with <tt>Loader.loadBytes()</tt>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eli</title>
		<link>http://dispatchevent.org/roger/embed-almost-anything-in-your-swf/comment-page-1/#comment-61169</link>
		<dc:creator>Eli</dc:creator>
		<pubDate>Sun, 02 Dec 2007 13:26:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/embed-almost-anything-in-your-swf#comment-61169</guid>
		<description>Hey Roger :)
That is cool example u have here.
Is there a chance it will work with *.flv ?
Actually I managed to embed it as byte array, but i could not figure how to translate it backwards.
The problem I&#039;m dealing with is that my client wants to put the player I made on a CD and he wants the videos to be part of the swf.
Another way could be embedding the whole folder into swf.
Is there a chance someone ever had to do it ?
Thanks a lot.
Fell free to contact me on my skype, the address is : atlaseli</description>
		<content:encoded><![CDATA[<p>Hey Roger :)<br />
That is cool example u have here.<br />
Is there a chance it will work with *.flv ?<br />
Actually I managed to embed it as byte array, but i could not figure how to translate it backwards.<br />
The problem I&#8217;m dealing with is that my client wants to put the player I made on a CD and he wants the videos to be part of the swf.<br />
Another way could be embedding the whole folder into swf.<br />
Is there a chance someone ever had to do it ?<br />
Thanks a lot.<br />
Fell free to contact me on my skype, the address is : atlaseli</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jun Heider</title>
		<link>http://dispatchevent.org/roger/embed-almost-anything-in-your-swf/comment-page-1/#comment-56959</link>
		<dc:creator>Jun Heider</dc:creator>
		<pubDate>Fri, 16 Nov 2007 00:56:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/embed-almost-anything-in-your-swf#comment-56959</guid>
		<description>Hello Roger,

I&#039;m having issues using your xml embed technique.  I have a feeling it may be my prolog.

Would you be open to providing us with test.xml that you used in the example above so that we can test with an XML file that works?

Thanks!</description>
		<content:encoded><![CDATA[<p>Hello Roger,</p>
<p>I&#8217;m having issues using your xml embed technique.  I have a feeling it may be my prolog.</p>
<p>Would you be open to providing us with test.xml that you used in the example above so that we can test with an XML file that works?</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ruben Swieringa</title>
		<link>http://dispatchevent.org/roger/embed-almost-anything-in-your-swf/comment-page-1/#comment-56205</link>
		<dc:creator>Ruben Swieringa</dc:creator>
		<pubDate>Tue, 13 Nov 2007 20:28:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/embed-almost-anything-in-your-swf#comment-56205</guid>
		<description>Hey Roger, are you sure the XML-example works for you? I tried it out in Flex Builder (2) and all I got was the toString() representation (&quot;[object Model_EmbeddedXML]&quot;)..</description>
		<content:encoded><![CDATA[<p>Hey Roger, are you sure the XML-example works for you? I tried it out in Flex Builder (2) and all I got was the toString() representation (&#8221;[object Model_EmbeddedXML]&#8220;)..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthias</title>
		<link>http://dispatchevent.org/roger/embed-almost-anything-in-your-swf/comment-page-1/#comment-42185</link>
		<dc:creator>Matthias</dc:creator>
		<pubDate>Mon, 15 Oct 2007 21:10:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/embed-almost-anything-in-your-swf#comment-42185</guid>
		<description>Hello,
I have the same problems mentioned in the other comments. I get also  the error xmltagstartend unexpected. So how does it really work to embed XML?
Please help!</description>
		<content:encoded><![CDATA[<p>Hello,<br />
I have the same problems mentioned in the other comments. I get also  the error xmltagstartend unexpected. So how does it really work to embed XML?<br />
Please help!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
