<?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: Setting the volume on a VideoDisplay control in Flex</title>
	<atom:link href="http://blog.flexexamples.com/2008/08/24/setting-the-volume-on-a-videodisplay-control-in-flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2008/08/24/setting-the-volume-on-a-videodisplay-control-in-flex/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Sat, 11 Feb 2012 11:51:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: joe</title>
		<link>http://blog.flexexamples.com/2008/08/24/setting-the-volume-on-a-videodisplay-control-in-flex/comment-page-1/#comment-8799</link>
		<dc:creator>joe</dc:creator>
		<pubDate>Tue, 04 Jan 2011 18:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/24/setting-the-volume-on-a-videodisplay-control-in-flex/#comment-8799</guid>
		<description>Hi Peter,
how to set the controls directly over the VideoDisplay?
For Example how could i fade in the volume slider if the mouse is over that video?
WIth AS dynamically</description>
		<content:encoded><![CDATA[<p>Hi Peter,<br />
how to set the controls directly over the VideoDisplay?<br />
For Example how could i fade in the volume slider if the mouse is over that video?<br />
WIth AS dynamically</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arun</title>
		<link>http://blog.flexexamples.com/2008/08/24/setting-the-volume-on-a-videodisplay-control-in-flex/comment-page-1/#comment-3682</link>
		<dc:creator>Arun</dc:creator>
		<pubDate>Wed, 29 Apr 2009 13:16:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/24/setting-the-volume-on-a-videodisplay-control-in-flex/#comment-3682</guid>
		<description>That was useful, thanks</description>
		<content:encoded><![CDATA[<p>That was useful, thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2008/08/24/setting-the-volume-on-a-videodisplay-control-in-flex/comment-page-1/#comment-3684</link>
		<dc:creator>peterd</dc:creator>
		<pubDate>Sun, 07 Sep 2008 23:00:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/24/setting-the-volume-on-a-videodisplay-control-in-flex/#comment-3684</guid>
		<description>Seis Pesos,

Yeah, I don&#039;t know if that is the best approach, but I didn&#039;t see a way to pause the Sound/SoundChannel object. So I just kept track of the current audio playhead position and passed that parameter to the &lt;code&gt;play()&lt;/code&gt; method.

As for controlling the volume, I just set the &lt;code&gt;volume&lt;/code&gt; property on a SoundTransform object.

Peter</description>
		<content:encoded><![CDATA[<p>Seis Pesos,</p>
<p>Yeah, I don&#8217;t know if that is the best approach, but I didn&#8217;t see a way to pause the Sound/SoundChannel object. So I just kept track of the current audio playhead position and passed that parameter to the <code>play()</code> method.</p>
<p>As for controlling the volume, I just set the <code>volume</code> property on a SoundTransform object.</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Seis Pesos</title>
		<link>http://blog.flexexamples.com/2008/08/24/setting-the-volume-on-a-videodisplay-control-in-flex/comment-page-1/#comment-3685</link>
		<dc:creator>Seis Pesos</dc:creator>
		<pubDate>Sun, 07 Sep 2008 21:20:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/24/setting-the-volume-on-a-videodisplay-control-in-flex/#comment-3685</guid>
		<description>Peter,
I never imagine &quot;var pos&quot;, thank you!</description>
		<content:encoded><![CDATA[<p>Peter,<br />
I never imagine &#8220;var pos&#8221;, thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2008/08/24/setting-the-volume-on-a-videodisplay-control-in-flex/comment-page-1/#comment-3683</link>
		<dc:creator>peterd</dc:creator>
		<pubDate>Sun, 07 Sep 2008 19:37:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/24/setting-the-volume-on-a-videodisplay-control-in-flex/#comment-3683</guid>
		<description>Seis Pesos,

Try something like the following:

&lt;pre class=&quot;code&quot;&gt;
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
        layout=&quot;vertical&quot;
        verticalAlign=&quot;middle&quot;
        paddingTop=&quot;0&quot;
        paddingLeft=&quot;0&quot;
        paddingRight=&quot;0&quot;
        paddingBottom=&quot;0&quot;&gt;

    &lt;mx:Style&gt;
        .playStyle {
            /* skin: Embed(&quot;assets/control_play.png&quot;); */
        }
        .stopStyle {
            /* skin: Embed(&quot;assets/control_stop.png&quot;); */
        }
        .pauseStyle {
            /* skin: Embed(&quot;assets/control_pause.png&quot;); */
        }
    &lt;/mx:Style&gt;

    &lt;mx:Script&gt;
    &lt;![CDATA[
        import flash.media.*;

        import mx.events.SliderEvent;

        [Bindable]
        [Embed(source=&quot;song.mp3&quot;)]
        public var sndCls:Class;

        public var pos:Number = 0;

        public var snd:Sound = new sndCls() as Sound;

        public var sndChannel:SoundChannel;

        public function playSound():void {
            sndChannel = snd.play(pos);
        }

        public function stopSound():void {
            sndChannel.stop();
            pos = 0;
        }

        public function pauseSound():void {
            pos = sndChannel.position;
            sndChannel.stop();
        }

        public function volume_change(evt:SliderEvent):void {
            var sndTransform:SoundTransform = sndChannel.soundTransform;
            sndTransform.volume = evt.value;
            sndChannel.soundTransform = sndTransform;
        }
    ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ControlBar paddingBottom=&quot;0&quot; paddingTop=&quot;0&quot;&gt;
        &lt;mx:Button id=&quot;playButton&quot;
                label=&quot;play&quot;
                styleName=&quot;playStyle&quot;
                click=&quot;playSound();&quot; /&gt;
        &lt;mx:Button id=&quot;stopButton&quot;
                label=&quot;stop&quot;
                styleName=&quot;stopStyle&quot;
                click=&quot;stopSound();&quot; /&gt;

        &lt;mx:Button id=&quot;pauseButton&quot;
                label=&quot;pause&quot;
                styleName=&quot;pauseStyle&quot;
                click=&quot;pauseSound();&quot; /&gt;

        &lt;mx:HSlider id=&quot;volume&quot;
                minimum=&quot;0.0&quot;
                maximum=&quot;1.0&quot;
                value=&quot;1.0&quot;
                snapInterval=&quot;0.01&quot;
                liveDragging=&quot;true&quot;
                change=&quot;volume_change(event);&quot; /&gt;
    &lt;/mx:ControlBar&gt;

&lt;/mx:Application&gt;
&lt;/pre&gt;

Peter</description>
		<content:encoded><![CDATA[<p>Seis Pesos,</p>
<p>Try something like the following:</p>
<pre class="code">
&lt;?xml version="1.0"?&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        paddingTop="0"
        paddingLeft="0"
        paddingRight="0"
        paddingBottom="0"&gt;

    &lt;mx:Style&gt;
        .playStyle {
            /* skin: Embed("assets/control_play.png"); */
        }
        .stopStyle {
            /* skin: Embed("assets/control_stop.png"); */
        }
        .pauseStyle {
            /* skin: Embed("assets/control_pause.png"); */
        }
    &lt;/mx:Style&gt;

    &lt;mx:Script&gt;
    &lt;![CDATA[
        import flash.media.*;

        import mx.events.SliderEvent;

        [Bindable]
        [Embed(source="song.mp3")]
        public var sndCls:Class;

        public var pos:Number = 0;

        public var snd:Sound = new sndCls() as Sound;

        public var sndChannel:SoundChannel;

        public function playSound():void {
            sndChannel = snd.play(pos);
        }

        public function stopSound():void {
            sndChannel.stop();
            pos = 0;
        }

        public function pauseSound():void {
            pos = sndChannel.position;
            sndChannel.stop();
        }

        public function volume_change(evt:SliderEvent):void {
            var sndTransform:SoundTransform = sndChannel.soundTransform;
            sndTransform.volume = evt.value;
            sndChannel.soundTransform = sndTransform;
        }
    ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ControlBar paddingBottom="0" paddingTop="0"&gt;
        &lt;mx:Button id="playButton"
                label="play"
                styleName="playStyle"
                click="playSound();" /&gt;
        &lt;mx:Button id="stopButton"
                label="stop"
                styleName="stopStyle"
                click="stopSound();" /&gt;

        &lt;mx:Button id="pauseButton"
                label="pause"
                styleName="pauseStyle"
                click="pauseSound();" /&gt;

        &lt;mx:HSlider id="volume"
                minimum="0.0"
                maximum="1.0"
                value="1.0"
                snapInterval="0.01"
                liveDragging="true"
                change="volume_change(event);" /&gt;
    &lt;/mx:ControlBar&gt;

&lt;/mx:Application&gt;
</pre>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Seis Pesos</title>
		<link>http://blog.flexexamples.com/2008/08/24/setting-the-volume-on-a-videodisplay-control-in-flex/comment-page-1/#comment-3686</link>
		<dc:creator>Seis Pesos</dc:creator>
		<pubDate>Sun, 07 Sep 2008 04:24:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/24/setting-the-volume-on-a-videodisplay-control-in-flex/#comment-3686</guid>
		<description>Hi Peterd,
I&#039;m trying to make simple MP3 player from Livedoc, but I can&#039;t add PAUSE and VOLUME control.
I need a little help,
http://japonyol.net/mp3.swf
Code:
&lt;pre class=&quot;code&quot;&gt;
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;vertical&quot; verticalAlign=&quot;middle&quot; paddingTop=&quot;0&quot; paddingLeft=&quot;0&quot; paddingRight=&quot;0&quot; paddingBottom=&quot;0&quot;&gt;
&lt;mx:Style&gt;
  .playStyle {
    skin: Embed(&#039;assets/control_play.png&#039;);
  }
  .stopStyle {
    skin: Embed(&#039;assets/control_stop.png&#039;);
  }
&lt;/mx:Style&gt;
    &lt;mx:Script&gt;
        &lt;![CDATA[
            import flash.media.*;
            [Embed(source=&quot;h_suazo.mp3&quot;)]
            [Bindable]
            public var sndCls:Class;
            public var snd:Sound = new sndCls() as Sound;
            public var sndChannel:SoundChannel;
            public function playSound():void {
                sndChannel=snd.play();
            }
            public function stopSound():void {
                sndChannel.stop();
            }
        ]]&gt;
    &lt;/mx:Script&gt;
    &lt;mx:ControlBar paddingBottom=&quot;0&quot; paddingTop=&quot;0&quot;&gt;
        &lt;mx:Button styleName=&quot;playStyle&quot; click=&quot;playSound();&quot;/&gt;
        &lt;mx:Button styleName=&quot;stopStyle&quot; click=&quot;stopSound();&quot;/&gt;

    &lt;/mx:ControlBar&gt;
&lt;/mx:Application&gt;
&lt;/pre&gt;

Thanks in advance...</description>
		<content:encoded><![CDATA[<p>Hi Peterd,<br />
I&#8217;m trying to make simple MP3 player from Livedoc, but I can&#8217;t add PAUSE and VOLUME control.<br />
I need a little help,<br />
<a href="http://japonyol.net/mp3.swf" rel="nofollow">http://japonyol.net/mp3.swf</a><br />
Code:</p>
<pre class="code">
&lt;?xml version="1.0"?&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" paddingTop="0" paddingLeft="0" paddingRight="0" paddingBottom="0"&gt;
&lt;mx:Style&gt;
  .playStyle {
    skin: Embed('assets/control_play.png');
  }
  .stopStyle {
    skin: Embed('assets/control_stop.png');
  }
&lt;/mx:Style&gt;
    &lt;mx:Script&gt;
        &lt;![CDATA[
            import flash.media.*;
            [Embed(source="h_suazo.mp3")]
            [Bindable]
            public var sndCls:Class;
            public var snd:Sound = new sndCls() as Sound;
            public var sndChannel:SoundChannel;
            public function playSound():void {
                sndChannel=snd.play();
            }
            public function stopSound():void {
                sndChannel.stop();
            }
        ]]&gt;
    &lt;/mx:Script&gt;
    &lt;mx:ControlBar paddingBottom="0" paddingTop="0"&gt;
        &lt;mx:Button styleName="playStyle" click="playSound();"/&gt;
        &lt;mx:Button styleName="stopStyle" click="stopSound();"/&gt;

    &lt;/mx:ControlBar&gt;
&lt;/mx:Application&gt;
</pre>
<p>Thanks in advance&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

