<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Social Vitamin &#187; as3</title>
	<atom:link href="http://www.socialvitamin.com/tag/as3/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.socialvitamin.com</link>
	<description>Give your social space a vitamin boost.</description>
	<lastBuildDate>Tue, 20 Sep 2011 17:02:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Reading ID3 tags with AS3</title>
		<link>http://www.socialvitamin.com/2009/04/03/reading-id3-tags-with-as3/</link>
		<comments>http://www.socialvitamin.com/2009/04/03/reading-id3-tags-with-as3/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 07:58:54 +0000</pubDate>
		<dc:creator>Michael D. Irizarry</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[id3]]></category>
		<category><![CDATA[mp3]]></category>

		<guid isPermaLink="false">http://www.socialvitamin.com/?p=35</guid>
		<description><![CDATA[In order to access the ID3 Tags of an MP3 remotely you need to pass the SoundLoaderContext class with the checkPolicyFile property set to true to the Sound class load [...]]]></description>
			<content:encoded><![CDATA[<p>In order to access the ID3 Tags of an MP3 remotely you need to pass the SoundLoaderContext class with the checkPolicyFile property set to true to the Sound class load method. If not Event.ID3 will not be fired since it will throw a security sandbox violation. Also you need to remember one important step that is having a cross domain policy file in the root of the server that will be serving the MP3 files.</p>
<p>AS3 Code</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> soundLoaderContext:SoundLoaderContext = <span style="color: #000000; font-weight: bold;">new</span> SoundLoaderContext<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
soundLoaderContext.<span style="color: #006600;">checkPolicyFile</span> = <span style="color: #000000; font-weight: bold;">true</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> mp3:URLRequest = <span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;weezer-pork_and_beans.mp3&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">sound</span>:<span style="color: #0066CC;">Sound</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Sound</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">sound</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #0066CC;">ID3</span>, id3Handler<span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">sound</span>.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span>mp3, soundLoaderContext<span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">sound</span>.<span style="color: #0066CC;">play</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// ID3 events</span>
<span style="color: #000000; font-weight: bold;">function</span> id3Handler<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">id3</span>:ID3Info = evt.<span style="color: #0066CC;">target</span>.<span style="color: #0066CC;">id3</span>;
      <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">id3</span>.<span style="color: #006600;">artist</span> + <span style="color: #ff0000;">' - '</span> + <span style="color: #0066CC;">id3</span>.<span style="color: #006600;">songName</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>cross-domain XML</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">&nbsp;
<span style="color: #009900;">&lt;? xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;cross-domain-policy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;allow-access-from</span> <span style="color: #000066;">domain</span>=<span style="color: #ff0000;">&quot;*.domain.com&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/allow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/cross<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.socialvitamin.com/2009/04/03/reading-id3-tags-with-as3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

