<?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: Create a Mini Music Player in AS3</title>
	<atom:link href="http://flashspeaksactionscript.com/create-a-mini-music-player-in-as3/feed/" rel="self" type="application/rss+xml" />
	<link>http://flashspeaksactionscript.com/create-a-mini-music-player-in-as3/</link>
	<description>Learn and Speak Actionscript</description>
	<lastBuildDate>Wed, 10 Feb 2010 22:20:43 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Rhiannon</title>
		<link>http://flashspeaksactionscript.com/create-a-mini-music-player-in-as3/comment-page-1/#comment-48730</link>
		<dc:creator>Rhiannon</dc:creator>
		<pubDate>Wed, 20 Jan 2010 18:22:55 +0000</pubDate>
		<guid isPermaLink="false">http://flashspeaksactionscript.com/create-a-mini-music-player-in-as3/#comment-48730</guid>
		<description>Hi, Just to say this is a fantastic post - I am very much a beginner in flash and I found it very clear and simple to follow. And most importantly it works for me.  
Any chance you could add another tutorial or let me know what the code would be to add a fast forward and a rewind button?  
Thanks 
 </description>
		<content:encoded><![CDATA[<p>Hi, Just to say this is a fantastic post &#8211; I am very much a beginner in flash and I found it very clear and simple to follow. And most importantly it works for me.<br />
Any chance you could add another tutorial or let me know what the code would be to add a fast forward and a rewind button?<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rhoda</title>
		<link>http://flashspeaksactionscript.com/create-a-mini-music-player-in-as3/comment-page-1/#comment-47994</link>
		<dc:creator>Rhoda</dc:creator>
		<pubDate>Thu, 07 Jan 2010 21:23:02 +0000</pubDate>
		<guid isPermaLink="false">http://flashspeaksactionscript.com/create-a-mini-music-player-in-as3/#comment-47994</guid>
		<description>It mostly works...trying to get music to play in the browser itself and it&#039;s not working, thought it works fine in flash player. IDK.  </description>
		<content:encoded><![CDATA[<p>It mostly works&#8230;trying to get music to play in the browser itself and it&#039;s not working, thought it works fine in flash player. IDK.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steffen</title>
		<link>http://flashspeaksactionscript.com/create-a-mini-music-player-in-as3/comment-page-1/#comment-45017</link>
		<dc:creator>Steffen</dc:creator>
		<pubDate>Wed, 11 Nov 2009 14:34:30 +0000</pubDate>
		<guid isPermaLink="false">http://flashspeaksactionscript.com/create-a-mini-music-player-in-as3/#comment-45017</guid>
		<description>Koki,

you add something like that. I dont tested it:

sound.addEventListener(NetStatusEvent.NET_STATUS, handlerFunction);

private function handlerFunction(event:NetStatusEvent):void{
      if(event.info.code==&quot;NetStream.Play.Stop&quot;){
       sound.seek(0);
       sound.playSound();
      }
}        

Test and try it.</description>
		<content:encoded><![CDATA[<p>Koki,</p>
<p>you add something like that. I dont tested it:</p>
<p>sound.addEventListener(NetStatusEvent.NET_STATUS, handlerFunction);</p>
<p>private function handlerFunction(event:NetStatusEvent):void{<br />
      if(event.info.code==&#8221;NetStream.Play.Stop&#8221;){<br />
       sound.seek(0);<br />
       sound.playSound();<br />
      }<br />
}        </p>
<p>Test and try it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Koki</title>
		<link>http://flashspeaksactionscript.com/create-a-mini-music-player-in-as3/comment-page-1/#comment-43463</link>
		<dc:creator>Koki</dc:creator>
		<pubDate>Wed, 30 Sep 2009 17:56:28 +0000</pubDate>
		<guid isPermaLink="false">http://flashspeaksactionscript.com/create-a-mini-music-player-in-as3/#comment-43463</guid>
		<description>How can I make it play automatically and keep looping?
Thanks</description>
		<content:encoded><![CDATA[<p>How can I make it play automatically and keep looping?<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brad</title>
		<link>http://flashspeaksactionscript.com/create-a-mini-music-player-in-as3/comment-page-1/#comment-41337</link>
		<dc:creator>brad</dc:creator>
		<pubDate>Thu, 13 Aug 2009 02:29:21 +0000</pubDate>
		<guid isPermaLink="false">http://flashspeaksactionscript.com/create-a-mini-music-player-in-as3/#comment-41337</guid>
		<description>Great tutorial. I&#039;m getting two &quot;1120:Access of undefined property sc.&quot; errors though. First one for

if (sc != null)

And the second one for

sc.soundTransform = st;

Here is my code:

stop();

var soundReq:URLRequest = new URLRequest(&quot;kennypowersaudiobook.mp3&quot;);
var sound:Sound = new Sound();
var soundControl:SoundChannel = new SoundChannel();
var isPlaying:Boolean = false;
var resumeTime:Number = 0;

sound.load(soundReq);
sound.addEventListener(Event.COMPLETE, onComplete);

function onComplete(event:Event):void {
	play_btn.addEventListener(MouseEvent.CLICK, playSound);
	stop_btn.addEventListener(MouseEvent.CLICK, stopSound);
	back_btn.addEventListener(MouseEvent.CLICK, goBack);
}

function playSound(event:MouseEvent):void {
	soundControl = sound.play(resumeTime);
	pause_btn.visible = true;
	pause_btn.addEventListener(MouseEvent.CLICK, pauseSound);
	play_btn.visible = false;
	pause_btn.removeEventListener(MouseEvent.CLICK, playSound);
}

function pauseSound(event:MouseEvent):void {
	resumeTime = soundControl.position;
	soundControl.stop();
	play_btn.visible = true;
}

function stopSound(event:MouseEvent):void {
	soundControl.stop();
}

function goBack(e:MouseEvent):void {
	gotoAndPlay(&quot;193&quot;);
}

//---VOLUME SLIDER---//
var dragging:Boolean = false;
var rectangle:Rectangle = new Rectangle(0,0,100,0);
volume_mc.slider_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragIt);
stage.addEventListener(MouseEvent.MOUSE_UP, dropIt);

function dragIt(e:Event):void {
	volume_mc.slider_mc.startDrag(false,rectangle);
	dragging = true;
	volume_mc.slider_mc.addEventListener(Event.ENTER_FRAME, adjustVolume);
}

function dropIt(e:Event):void {
	if (dragging) {
		volume_mc.slider_mc.stopDrag();
		dragging = false;
	}
}

function adjustVolume(e:Event):void {
	var vol:Number = volume_mc.slider_mc.x / 100;
	var st:SoundTransform = new SoundTransform(vol);
	if (sc != null) {
		sc.soundTransform = st;
	}
}



Any information would be greatly appreciated.</description>
		<content:encoded><![CDATA[<p>Great tutorial. I&#8217;m getting two &#8220;1120:Access of undefined property sc.&#8221; errors though. First one for</p>
<p>if (sc != null)</p>
<p>And the second one for</p>
<p>sc.soundTransform = st;</p>
<p>Here is my code:</p>
<p>stop();</p>
<p>var soundReq:URLRequest = new URLRequest(&#8221;kennypowersaudiobook.mp3&#8243;);<br />
var sound:Sound = new Sound();<br />
var soundControl:SoundChannel = new SoundChannel();<br />
var isPlaying:Boolean = false;<br />
var resumeTime:Number = 0;</p>
<p>sound.load(soundReq);<br />
sound.addEventListener(Event.COMPLETE, onComplete);</p>
<p>function onComplete(event:Event):void {<br />
	play_btn.addEventListener(MouseEvent.CLICK, playSound);<br />
	stop_btn.addEventListener(MouseEvent.CLICK, stopSound);<br />
	back_btn.addEventListener(MouseEvent.CLICK, goBack);<br />
}</p>
<p>function playSound(event:MouseEvent):void {<br />
	soundControl = sound.play(resumeTime);<br />
	pause_btn.visible = true;<br />
	pause_btn.addEventListener(MouseEvent.CLICK, pauseSound);<br />
	play_btn.visible = false;<br />
	pause_btn.removeEventListener(MouseEvent.CLICK, playSound);<br />
}</p>
<p>function pauseSound(event:MouseEvent):void {<br />
	resumeTime = soundControl.position;<br />
	soundControl.stop();<br />
	play_btn.visible = true;<br />
}</p>
<p>function stopSound(event:MouseEvent):void {<br />
	soundControl.stop();<br />
}</p>
<p>function goBack(e:MouseEvent):void {<br />
	gotoAndPlay(&#8221;193&#8243;);<br />
}</p>
<p>//&#8212;VOLUME SLIDER&#8212;//<br />
var dragging:Boolean = false;<br />
var rectangle:Rectangle = new Rectangle(0,0,100,0);<br />
volume_mc.slider_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragIt);<br />
stage.addEventListener(MouseEvent.MOUSE_UP, dropIt);</p>
<p>function dragIt(e:Event):void {<br />
	volume_mc.slider_mc.startDrag(false,rectangle);<br />
	dragging = true;<br />
	volume_mc.slider_mc.addEventListener(Event.ENTER_FRAME, adjustVolume);<br />
}</p>
<p>function dropIt(e:Event):void {<br />
	if (dragging) {<br />
		volume_mc.slider_mc.stopDrag();<br />
		dragging = false;<br />
	}<br />
}</p>
<p>function adjustVolume(e:Event):void {<br />
	var vol:Number = volume_mc.slider_mc.x / 100;<br />
	var st:SoundTransform = new SoundTransform(vol);<br />
	if (sc != null) {<br />
		sc.soundTransform = st;<br />
	}<br />
}</p>
<p>Any information would be greatly appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dloadmp3</title>
		<link>http://flashspeaksactionscript.com/create-a-mini-music-player-in-as3/comment-page-1/#comment-40883</link>
		<dc:creator>Dloadmp3</dc:creator>
		<pubDate>Fri, 31 Jul 2009 16:56:10 +0000</pubDate>
		<guid isPermaLink="false">http://flashspeaksactionscript.com/create-a-mini-music-player-in-as3/#comment-40883</guid>
		<description>huh_ that&#039;s nice!</description>
		<content:encoded><![CDATA[<p>huh_ that&#8217;s nice!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Müzik indir</title>
		<link>http://flashspeaksactionscript.com/create-a-mini-music-player-in-as3/comment-page-1/#comment-38990</link>
		<dc:creator>Müzik indir</dc:creator>
		<pubDate>Fri, 05 Jun 2009 20:16:20 +0000</pubDate>
		<guid isPermaLink="false">http://flashspeaksactionscript.com/create-a-mini-music-player-in-as3/#comment-38990</guid>
		<description>Thanks for that article. I read all of them.</description>
		<content:encoded><![CDATA[<p>Thanks for that article. I read all of them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: HombreMoleculos</title>
		<link>http://flashspeaksactionscript.com/create-a-mini-music-player-in-as3/comment-page-1/#comment-34817</link>
		<dc:creator>HombreMoleculos</dc:creator>
		<pubDate>Thu, 02 Apr 2009 15:21:10 +0000</pubDate>
		<guid isPermaLink="false">http://flashspeaksactionscript.com/create-a-mini-music-player-in-as3/#comment-34817</guid>
		<description>Worked great, thanks.</description>
		<content:encoded><![CDATA[<p>Worked great, thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abstriumsters</title>
		<link>http://flashspeaksactionscript.com/create-a-mini-music-player-in-as3/comment-page-1/#comment-32710</link>
		<dc:creator>Abstriumsters</dc:creator>
		<pubDate>Wed, 25 Feb 2009 22:29:52 +0000</pubDate>
		<guid isPermaLink="false">http://flashspeaksactionscript.com/create-a-mini-music-player-in-as3/#comment-32710</guid>
		<description>beautiful site..))
I will go to you.</description>
		<content:encoded><![CDATA[<p>beautiful site..))<br />
I will go to you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sicher</title>
		<link>http://flashspeaksactionscript.com/create-a-mini-music-player-in-as3/comment-page-1/#comment-28627</link>
		<dc:creator>Sicher</dc:creator>
		<pubDate>Wed, 14 Jan 2009 21:52:49 +0000</pubDate>
		<guid isPermaLink="false">http://flashspeaksactionscript.com/create-a-mini-music-player-in-as3/#comment-28627</guid>
		<description>You should call removeEventLisener when drop:

function dropIt(e:Event):void
{
	if (dragging)
	{
		volume_mc.slider_mc.stopDrag();
		dragging = false;
                volume_mc.slider_mc.removeEventListener(Event.ENTER_FRAME, adjustVolume);

	}
}</description>
		<content:encoded><![CDATA[<p>You should call removeEventLisener when drop:</p>
<p>function dropIt(e:Event):void<br />
{<br />
	if (dragging)<br />
	{<br />
		volume_mc.slider_mc.stopDrag();<br />
		dragging = false;<br />
                volume_mc.slider_mc.removeEventListener(Event.ENTER_FRAME, adjustVolume);</p>
<p>	}<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
