<?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>Derek J Entringer &#124; Interactive Media, Web Application, and Mobile App Developer &#187; as3</title>
	<atom:link href="http://www.derekentringer.com/blog/tag/as3/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.derekentringer.com/blog</link>
	<description>Interactive Media Development, Web Application Development, Mobile App Development, Flash, Flash Media Server, Flex, Flash Component Creation, Game Programming &#38; Design, Blog, CMS, eCommerce Setup &#38; Styling, Search Engine Optimization, Social Networking Strategies, Website Interface &#38; Template Creation, Windows Vista Gadget Development, Apple Widget Development, Email Marketing, Code Samples, Tutorials</description>
	<lastBuildDate>Tue, 13 Jul 2010 19:25:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Augmented Reality Using Flex, AS3, And A WebCam</title>
		<link>http://www.derekentringer.com/blog/augmented-reality-using-flex-as3-and-a-webcam/</link>
		<comments>http://www.derekentringer.com/blog/augmented-reality-using-flex-as3-and-a-webcam/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 01:15:27 +0000</pubDate>
		<dc:creator>Derek J Entringer</dc:creator>
				<category><![CDATA[Code Samples]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[General Discussion]]></category>
		<category><![CDATA[New Developments]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[augmented]]></category>
		<category><![CDATA[reality]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://www.derekentringer.com/blog/?p=400</guid>
		<description><![CDATA[
			
				
			
		

Augmented reality (AR) on the Flash and Flex platform is really quite a new technology, but there are a large amount of developers and businesses that are embracing the use of AR online. Media companies such as Esquire, and technology companies such as GE are using the tech to engage their users both through print media as well as online media.
AR research explores the application of computer-generated imagery in live-video streams as a way to expand the real-world.
The possibilities of how you could use Augmented Reality (AR) are endless. Picture ...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="clear:left; float:left; margin-top:10px; margin-bottom: 10px; margin-right:12px; margin-left:2px;">
			<a href="http://www.derekentringer.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2FwaS50d2VldG1lbWUuY29tL3NoYXJlP3VybD1odHRwJTNBJTJGJTJGd3d3LmRlcmVrZW50cmluZ2VyLmNvbSUyRmJsb2clMkZhdWdtZW50ZWQtcmVhbGl0eS11c2luZy1mbGV4LWFzMy1hbmQtYS13ZWJjYW0lMkY="><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.derekentringer.com%2Fblog%2Faugmented-reality-using-flex-as3-and-a-webcam%2F&amp;source=derekentringer&amp;style=normal&amp;service=TinyURL.com" height="61" width="50" /><br />
			</a>
		</div>
<p><!--PLAIN_TEXT--><br />
Augmented reality (AR) on the Flash and Flex platform is really quite a new technology, but there are a large amount of developers and businesses that are embracing the use of AR online. Media companies such as <a href="http://www.derekentringer.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL21hc2hhYmxlLmNvbS8yMDA5LzEwLzMwL2VzcXVpcmUtYXVnbWVudGVkLXJlYWxpdHkv">Esquire</a>, and technology companies such as <a href="http://www.derekentringer.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2dlLmVjb21hZ2luYXRpb24uY29tL3NtYXJ0Z3JpZC8/Y19pZD1nb29nYXVncmVhbCYjMDM4O2djbGlkPUNQei0wXzJJOHAwQ0ZjbU41d29kRkdSTXhRIy9hdWdtZW50ZWRfcmVhbGl0eQ==">GE</a> are using the tech to engage their users both through print media as well as online media.</p>
<p>AR research explores the application of computer-generated imagery in live-video streams as a way to expand the real-world.</p>
<p>The possibilities of how you could use Augmented Reality (AR) are endless. Picture yourself walking or driving down the street. With augmented-reality displays, which will eventually look much like a normal pair of glasses, and informative graphics appearing in your field of view, and audio that coincides with whatever you see.</p>
<p>Now, this article doesn&#8217;t go as far as how to create your own AR glasses, but rather a &#8220;first step&#8221; into what is capable when using AR.</p>
<p>I&#8217;ve created a quick example of an AR environment below. Using your webcam, and the provided PDF, you can experience what AR is all about. Make sure to take a look at some more advanced examples in the links above also.</p>
<p>First, print <a href="http://www.derekentringer.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5kZXJla2VudHJpbmdlci5jb20vZG93bmxvYWRzL2FyL2RlcmVrZW50cmluZ2VyLnBkZg==" target=\"_blank\">this PDF</a>.</p>
<p>Next, activate the Flash movie below to allow access to your webcam, and hold up the piece of paper to the camera to activate the AR environment. Make sure the large square is fully visible within the camera, and you&#8217;ll see how the AR loads and animates with how you position the paper.</p>
<p><script language="JavaScript" type="text/javascript">
	AC_FL_RunContent(
		'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
		'width', '570',
		'height', '400',
		'src', 'http://www.derekentringer.com/downloads/ar/FLARdemo',
		'quality', 'high',
		'pluginspage', 'http://www.adobe.com/go/getflashplayer',
		'align', 'middle',
		'play', 'true',
		'loop', 'true',
		'scale', 'showall',
		'wmode', 'window',
		'devicefont', 'false',
		'id', 'FLARdemo',
		'bgcolor', '#0F0F0F',
		'name', 'FLARdemo',
		'menu', 'false',
		'allowFullScreen', 'true',
		'allowScriptAccess','sameDomain',
		'movie', 'http://www.derekentringer.com/downloads/ar/FLARdemo',
		'salign', ''
		); //end AC code
</script><br />
<noscript><br />
	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="570" height="400" id="FLARdemo" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="movie" value="http://www.derekentringer.com/downloads/ar/FLARdemo.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#0F0F0F" /><embed src="http://www.derekentringer.com/downloads/ar/FLARdemo.swf" quality="high" bgcolor="#0F0F0F" width="570" height="400" name="FLARdemo" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" /><br />
	</object><br />
</noscript></p>
<p>Like I said, this example is brief. The AR that you will see above when holding up the pattern you printed is quite simple. There will be three cubes that will be displayed within your streaming video. The AR environment reacts to wherever the pattern on the printed pdf goes. You can rotate or angle the pattern against the camera, the the AR will follow.</p>
<p>There are many ways that this small &#8220;first step&#8221; towards a more interactive AR environment can be upgraded, and it&#8217;s only a start.</p>
<p>Using this technology you can stream video, add animations, or animate entire environments. You could green-screen actors or musicians and place them in a music video that comes to life seemingly right in your own hands. There are thousands of ways to implement AR to engage your website visitors or publication readers. Artist labels could use AR in their branding or CD packaging, or anyone with a business card could use AR to allow for mini-presentations. Whether that be a video or information displayed to a potential client by simply holding your business card card up to their webcam, while visiting your own website.</p>
<p>The ways of incorporating Augmented Reality into online and print media are nearly endless.</p>
<p>If you do not have a web cam, here&#8217;s how this simple example looks.</p>
<p><script type="text/javascript" src="http://flvplayer.com/free-flv-player/flvplayer/swfobject/swfobject.js"></script></p>
<div id="embed_player">
<h1>Please Upgrade Your Flash Player</h1>
<p><a href="http://www.derekentringer.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5hZG9iZS5jb20vZ28vZ2V0Zmxhc2hwbGF5ZXI="><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
</div>
<p><script type="text/javascript">
var flashvars = {
flvpFolderLocation: "http://flvplayer.com/free-flv-player/flvplayer/", 
flvpVideoSource: "http://www.derekentringer.com/downloads/ar/ar_demo.mp4", 
flvpWidth: "568", 
flvpHeight: "400", 
flvpInitVolume: "50", 
flvpTurnOnCorners: "true", 
flvpBgColor: "0F0F0F"
};
var params = {
bgcolor: "0F0F0F", 
menu: "true", 
allowfullscreen: "true"
};
swfobject.embedSWF("http://flvplayer.com/free-flv-player/FlvPlayer.swf", "embed_player", "568", "400", "9.0.0", "http://flvplayer.com/free-flv-player/flvplayer/swfobject/expressInstall.swf", flashvars, params);
</script></p>
<p>Have you used AR in any of your projects yet?</p>
 <img src="http://www.derekentringer.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=400" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.derekentringer.com/blog/augmented-reality-using-flex-as3-and-a-webcam/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
<enclosure url="http://www.derekentringer.com/downloads/ar/ar_demo.mp4" length="2222555" type="audio/mp4" />
		</item>
		<item>
		<title>Stream Your Videos Using FLV Player – FREE</title>
		<link>http://www.derekentringer.com/blog/stream-your-videos-using-flv-player-free/</link>
		<comments>http://www.derekentringer.com/blog/stream-your-videos-using-flv-player-free/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 06:56:57 +0000</pubDate>
		<dc:creator>Derek J Entringer</dc:creator>
				<category><![CDATA[Code Samples]]></category>
		<category><![CDATA[FMS]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash Components]]></category>
		<category><![CDATA[New Developments]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[components]]></category>
		<category><![CDATA[embed code]]></category>
		<category><![CDATA[flashvars]]></category>
		<category><![CDATA[flv]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[player]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[vimeo]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://www.derekentringer.com/blog/?p=346</guid>
		<description><![CDATA[
			
				
			
		

We&#8217;ve recently added some pretty significant new features to our FLV Player Flash Component. One really neat new offering is our Free FLV Player, which allows you to stream videos from Youtube!, Vimeo, or your own sources including Flash Media Server. All you need is a video source, your player width and height requirements, and you can get your embed code in 3 easy steps.
Take a look at FLV Player, and our new Free FLV Player at http://flvplayer.com.
If you ever wanted to add video to your projects or websites, there ...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="clear:left; float:left; margin-top:10px; margin-bottom: 10px; margin-right:12px; margin-left:2px;">
			<a href="http://www.derekentringer.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2FwaS50d2VldG1lbWUuY29tL3NoYXJlP3VybD1odHRwJTNBJTJGJTJGd3d3LmRlcmVrZW50cmluZ2VyLmNvbSUyRmJsb2clMkZzdHJlYW0teW91ci12aWRlb3MtdXNpbmctZmx2LXBsYXllci1mcmVlJTJG"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.derekentringer.com%2Fblog%2Fstream-your-videos-using-flv-player-free%2F&amp;source=derekentringer&amp;style=normal&amp;service=TinyURL.com" height="61" width="50" /><br />
			</a>
		</div>
<p><!--PLAIN_TEXT--><br />
We&#8217;ve recently added some pretty significant new features to our FLV Player Flash Component. One really neat new offering is our Free FLV Player, which allows you to stream videos from Youtube!, Vimeo, or your own sources including Flash Media Server. All you need is a video source, your player width and height requirements, and you can get your embed code in 3 easy steps.</p>
<p>Take a look at <a href="http://www.derekentringer.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2ZsdnBsYXllci5jb20=">FLV Player</a>, and our new <a href="http://www.derekentringer.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2ZsdnBsYXllci5jb20vZnJlZS1mbHYtcGxheWVyLw==">Free FLV Player</a> at <a href="http://www.derekentringer.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2ZsdnBsYXllci5jb20=">http://flvplayer.com</a>.</p>
<p>If you ever wanted to add video to your projects or websites, there is no easier way than using pre-built Flash video components. Our player is one of the most feature loaded components on the market and it was specifically designed to suit developer and designers needs. It provides a fast and easy way to add video content in just few steps.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="570" height="316" id="FlvPlayer" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="true" /><param name="movie" value="http://flvplayer.com/free-flv-player/FlvPlayer.swf" /><param name="quality" value="high" /><param name="bgcolor" value="0F0F0F" /><param name="FlashVars" value="flvpFolderLocation=http://flvplayer.com/free-flv-player/flvplayer/&#038;flvpVideoSource=http://flvplayer.com/media/Satutn_de_commercial.mp4&#038;flvpWidth=570&#038;flvpHeight=316&#038;flvpInitVolume=50&#038;flvpTurnOnCorners=true&#038;flvpBgColor=0F0F0F"<br />
<embed src="http://flvplayer.com/free-flv-player/FlvPlayer.swf" flashvars="flvpFolderLocation=http://flvplayer.com/free-flv-player/flvplayer/&#038;flvpVideoSource=http://flvplayer.com/media/Satutn_de_commercial.mp4&#038;flvpWidth=570&#038;flvpHeight=316&#038;flvpInitVolume=50&#038;flvpTurnOnCorners=true&#038;flvpBgColor=0F0F0F" quality="high" bgcolor="0F0F0F" width="570" height="316" name="FlvPlayer" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" /></object></p>
<p><a href="http://www.derekentringer.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2ZsdnBsYXllci5jb20vZnJlZS1mbHYtcGxheWVy">Get your own Free FLV Player here</a></p>
<p>Here are some more new features that we recently added to FLV Player:</p>
<p><b>FlashVar Support</b><br />
FlvPlayer now fully supports FlashVars. This is another layer of interactivity that we&#8217;ve created that allows anyone who doesn&#8217;t have Flash to also benefit from the player. It provides access to all of the parameters of the player directly from the swf embed code.</p>
<p><b>Tooltips</b><br />
We&#8217;ve upgraded the interface to allow for individual tooltips on all of the FLV Player elements. You also have the ability to control the colors and transparencies.</p>
<p><b>Stream YouTube! Videos</b><br />
Stream all of your favorite YouTube! videos directly in your website or blog using our custom PHP streaming scripts.</p>
<p><b>Stream Vimeo Videos</b><br />
Stream all of your favorite Vimeo! videos by simply letting FLV Player know the Vimeo video id.</p>
<p>
More information is available at <a href="http://www.derekentringer.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2ZsdnBsYXllci5jb20=">FLVplayer.com</a></p>
 <img src="http://www.derekentringer.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=346" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.derekentringer.com/blog/stream-your-videos-using-flv-player-free/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AS3 MP3 Player</title>
		<link>http://www.derekentringer.com/blog/as3-mp3-player/</link>
		<comments>http://www.derekentringer.com/blog/as3-mp3-player/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 16:22:33 +0000</pubDate>
		<dc:creator>Derek J Entringer</dc:creator>
				<category><![CDATA[Code Samples]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[player]]></category>

		<guid isPermaLink="false">http://derekentringer.com/blog/?p=70</guid>
		<description><![CDATA[
			
				
			
		

I have an upcoming project that will require an mp3 player that can load multiple songs, and let users choose which track they would like to listen to. I created this as a test, and will be developing it further for use on the site itself.
The player loads in mp3&#8242;s from an external file based on xml settings.
Here&#8217;s the actionscript 3 that is involved:

var getMusic:URLRequest;
var music:Sound = new Sound();
var soundChannel:SoundChannel;
var currentSound:Sound = music;
var pos:Number;
var currentIndex:Number = 0;
var songPlaying:Boolean = false;
var xml:XML;
var songlist:XMLList;
//preloader
function loadProgress(event:ProgressEvent):void {
    var percentLoaded:Number = ...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="clear:left; float:left; margin-top:10px; margin-bottom: 10px; margin-right:12px; margin-left:2px;">
			<a href="http://www.derekentringer.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2FwaS50d2VldG1lbWUuY29tL3NoYXJlP3VybD1odHRwJTNBJTJGJTJGd3d3LmRlcmVrZW50cmluZ2VyLmNvbSUyRmJsb2clMkZhczMtbXAzLXBsYXllciUyRg=="><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.derekentringer.com%2Fblog%2Fas3-mp3-player%2F&amp;source=derekentringer&amp;style=normal&amp;service=TinyURL.com" height="61" width="50" /><br />
			</a>
		</div>
<p><!--PLAIN_TEXT--><br />
I have an upcoming project that will require an mp3 player that can load multiple songs, and let users choose which track they would like to listen to. I created this as a test, and will be developing it further for use on the site itself.</p>
<p>The player loads in mp3&#8242;s from an external file based on xml settings.</p>
<p>Here&#8217;s the actionscript 3 that is involved:</p>
<pre class="brush: as3;">
var getMusic:URLRequest;
var music:Sound = new Sound();
var soundChannel:SoundChannel;
var currentSound:Sound = music;
var pos:Number;
var currentIndex:Number = 0;
var songPlaying:Boolean = false;
var xml:XML;
var songlist:XMLList;
//preloader
function loadProgress(event:ProgressEvent):void {
    var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
    percentLoaded = Math.round(percentLoaded * 100);
	if(percentLoaded &lt; 20){
		trace(&quot;loading&quot;);
	} else{
	}
}
function completeHandler(event):void {
    trace(&quot;DONE&quot;);
}
//load the xml
var loader:URLLoader = new URLLoader(); //create a new URLLoader Object
loader.addEventListener(Event.COMPLETE, whenLoaded); //add an event listener to that object
loader.load(new URLRequest(&quot;songs.xml&quot;)); //Requests our xml file that contains our song data
function whenLoaded(e:Event):void //WhenLoaded function(see line 50) runs when line 50 is complete
{
	xml = new XML(e.target.data);
	songlist = xml.song; //accesses our song tag in our xml file
	getMusic = new URLRequest(songlist[0].url);//get music from songlist
	music.load(getMusic);//load music
	soundChannel = music.play();//plays the music
	songTXT.text = songlist[0].title; //gets song name from xml
	artistTXT.text = songlist[0].artist; //gets artist name
	albumTXT.text = songlist[0].album;  //gets album name
	soundChannel.addEventListener(Event.SOUND_COMPLETE, nextSong);//runs the next song function when a song completes
}
//add mouse events
next_btn.addEventListener(MouseEvent.CLICK, nextSong);
prev_btn.addEventListener(MouseEvent.CLICK, prevSong);
pause_btn.addEventListener(MouseEvent.CLICK,pauseSong);
/*--------Skips Songs----------------------------------------*/
function nextSong(e:Event):void
{
	if (currentIndex &gt; (songlist.length() - 1))
	{
		currentIndex++;
	}
	else
	{
		currentIndex = 0;
	}
	var nextReq:URLRequest = new URLRequest(songlist[currentIndex].url);
	var nextTitle:Sound = new Sound(nextReq);
	soundChannel.stop();
	songTXT.text = songlist[currentIndex].title;
	artistTXT.text = songlist[currentIndex].artist;
	albumTXT.text = songlist[currentIndex].album;
	soundChannel = nextTitle.play();
	songPlaying = true;
	currentSound = nextTitle;
	soundChannel.addEventListener(Event.SOUND_COMPLETE, nextSong);
}
//manage songs, and load their info
function prevSong(e:Event):void
{
	if (currentIndex &lt; 0)
	{
		currentIndex--;
	}
	else
	{
		currentIndex = songlist.length() - 1;
	}
	var nextReq:URLRequest = new URLRequest(songlist[currentIndex].url);
	var prevTitle:Sound = new Sound(nextReq);
	soundChannel.stop();
	songTXT.text = songlist[currentIndex].title;
	artistTXT.text = songlist[currentIndex].artist;
	albumTXT.text = songlist[currentIndex].album;
	soundChannel = prevTitle.play();
	songPlaying = true;
	currentSound = prevTitle;
	soundChannel.addEventListener(Event.SOUND_COMPLETE, nextSong);
}
function pauseSong(e:Event):void
{
	pos = soundChannel.position; //pause song at current position
	soundChannel.stop(); //stop sound
	songPlaying = false; // songPlaying is now equal to false
	play_btn.addEventListener(MouseEvent.CLICK,playSong);
}
function playSong(e:Event):void
{
	if(songPlaying == false) //if songplaying is equal to false run function below
	{
		soundChannel = currentSound.play(pos); //play from current position(used if it was paused)
		soundChannel.addEventListener(Event.SOUND_COMPLETE, nextSong);//run nextSong function if current song is complete
		songPlaying = true; //songPlaying is now true
		play_btn.removeEventListener(MouseEvent.CLICK,playSong);
	}
}
</pre>
<p>
Here is the xml:</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;
&lt;ipod&gt;
	&lt;song&gt;
		&lt;title&gt;My Hero&lt;/title&gt;
		&lt;artist&gt;Foo Fighters&lt;/artist&gt;
		&lt;album&gt;The Colour And The Shape&lt;/album&gt;
		&lt;url&gt;songs/Hero.mp3&lt;/url&gt;
	&lt;/song&gt;
	&lt;song&gt;
		&lt;title&gt;Learn To Fly&lt;/title&gt;
		&lt;artist&gt;Foo Fighters&lt;/artist&gt;
		&lt;album&gt;Theres Nothing Left To Lose&lt;/album&gt;
		&lt;url&gt;songs/Fly.mp3&lt;/url&gt;
	&lt;/song&gt;
&lt;/ipod&gt;
</pre>
<p>
<a href="http://www.derekentringer.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5kZXJla2VudHJpbmdlci5jb20vZG93bmxvYWRzL21wM19wbGF5ZXIuemlw">Download the source</a> (Note: The mp3&#8242;s used are not included in the download)</p>
 <img src="http://www.derekentringer.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=70" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.derekentringer.com/blog/as3-mp3-player/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
