<?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>Flex Examples &#187; VideoDisplay</title>
	<atom:link href="http://blog.flexexamples.com/category/halo/videodisplay/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Displaying a semi-transparent FLV file in an MX VideoDisplay control in Flex 4</title>
		<link>http://blog.flexexamples.com/2010/01/21/displaying-a-semi-transparent-flv-file-in-an-mx-videodisplay-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2010/01/21/displaying-a-semi-transparent-flv-file-in-an-mx-videodisplay-control-in-flex-4/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 02:01:43 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta2]]></category>
		<category><![CDATA[VideoDisplay]]></category>
		<category><![CDATA[contentBackgroundAlpha]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2327</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2010/01/21/displaying-a-semi-transparent-flv-file-in-an-mx-videodisplay-control-in-flex/">&#8220;Displaying a semi-transparent FLV file in an MX VideoDisplay control in Flex&#8221;</a>, we saw how you could display an FLV file with alpha channel transparency in an MX VideoDisplay control in Flex 3 by setting the backgroundAlpha style to 0.</p> <p>The following example shows how you can display an FLV [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2010/01/21/displaying-a-semi-transparent-flv-file-in-an-mx-videodisplay-control-in-flex/">&#8220;Displaying a semi-transparent FLV file in an MX VideoDisplay control in Flex&#8221;</a>, we saw how you could display an FLV file with alpha channel transparency in an MX VideoDisplay control in Flex 3 by setting the <code>backgroundAlpha</code> style to 0.</p>
<p>The following example shows how you can display an FLV file with alpha channel transparency in an MX VideoDisplay control in Flex 4 by setting the <code>contentBackgroundAlpha</code> style to 0.</p>
<p>Full code after the jump.</p>
<p><span id="more-2327"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/01/21/displaying-a-semi-transparent-flv-file-in-an-mx-videodisplay-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;MX_VideoDisplay_contentBackgroundAlpha_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:LinearGradient</span> rotation=<span style="color: #ff0000;">&quot;90&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;red&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;blue&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:LinearGradient</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:VideoDisplay</span> id=<span style="color: #ff0000;">&quot;vidDisp&quot;</span></span>
<span style="color: #000000;">            source=<span style="color: #ff0000;">&quot;walking.flv&quot;</span></span>
<span style="color: #000000;">            contentBackgroundAlpha=<span style="color: #ff0000;">&quot;0.0&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;80%&quot;</span> height=<span style="color: #ff0000;">&quot;80%&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">            complete=<span style="color: #ff0000;">&quot;event.currentTarget.play();&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="note">The walking.flv can be found at the <a href="http://www.adobe.com/devnet/flash/articles/alpha_video.html">&#8220;Introducing True Alpha Video in Flash 8&#8243;</a> article in the <a href="http://www.adobe.com/devnet/flash/">Adobe Flash Developer Center</a>.</p>
<p class="alert">This entry is based on a beta version of the Flex 4 SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Displaying a semi-transparent FLV file in an MX VideoDisplay control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/01/21/displaying-a-semi-transparent-flv-file-in-an-mx-videodisplay-control-in-flex-4/',contentID: 'post-2327',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'contentBackgroundAlpha,Gumbo',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2010/01/21/displaying-a-semi-transparent-flv-file-in-an-mx-videodisplay-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Displaying a semi-transparent FLV file in an MX VideoDisplay control in Flex</title>
		<link>http://blog.flexexamples.com/2010/01/21/displaying-a-semi-transparent-flv-file-in-an-mx-videodisplay-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2010/01/21/displaying-a-semi-transparent-flv-file-in-an-mx-videodisplay-control-in-flex/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 01:24:33 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[VideoDisplay]]></category>
		<category><![CDATA[backgroundAlpha]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2323</guid>
		<description><![CDATA[<p>The following example shows how you can display an FLV file with alpha channel transparency in an MX VideoDisplay control in Flex 3 by setting the backgroundAlpha style to 0.</p> <p>Full code after the jump.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2010/01/21/displaying-a-semi-transparent-flv-file-in-an-mx-videodisplay-control-in-flex/ --&#62; &#60;mx:Application name=&#34;VideoDisplay_backgroundAlpha_test&#34; xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;absolute&#34; backgroundGradientColors=&#34;[#FF0000,#0000FF]&#34;&#62; &#160; &#60;mx:VideoDisplay id=&#34;vidDisp&#34; source=&#34;walking.flv&#34; backgroundAlpha=&#34;0.0&#34; width=&#34;80%&#34; height=&#34;80%&#34; horizontalCenter=&#34;0&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can display an FLV file with alpha channel transparency in an MX VideoDisplay control in Flex 3 by setting the <code>backgroundAlpha</code> style to 0.</p>
<p>Full code after the jump.</p>
<p><span id="more-2323"></span></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/01/21/displaying-a-semi-transparent-flv-file-in-an-mx-videodisplay-control-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;VideoDisplay_backgroundAlpha_test&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;absolute&quot;</span></span>
<span style="color: #000000;">        backgroundGradientColors=<span style="color: #ff0000;">&quot;[#FF0000,#0000FF]&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:VideoDisplay</span> id=<span style="color: #ff0000;">&quot;vidDisp&quot;</span></span>
<span style="color: #000000;">            source=<span style="color: #ff0000;">&quot;walking.flv&quot;</span></span>
<span style="color: #000000;">            backgroundAlpha=<span style="color: #ff0000;">&quot;0.0&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;80%&quot;</span> height=<span style="color: #ff0000;">&quot;80%&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">            complete=<span style="color: #ff0000;">&quot;event.currentTarget.play();&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="note">The walking.flv can be found at the <a href="http://www.adobe.com/devnet/flash/articles/alpha_video.html">&#8220;Introducing True Alpha Video in Flash 8&#8243;</a> article in the <a href="http://www.adobe.com/devnet/flash/">Adobe Flash Developer Center</a>.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Displaying a semi-transparent FLV file in an MX VideoDisplay control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/01/21/displaying-a-semi-transparent-flv-file-in-an-mx-videodisplay-control-in-flex/',contentID: 'post-2323',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'backgroundAlpha',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2010/01/21/displaying-a-semi-transparent-flv-file-in-an-mx-videodisplay-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maintaining an video&#8217;s aspect ratio on a VideoDisplay control in Flex</title>
		<link>http://blog.flexexamples.com/2008/12/30/maintaining-an-videos-aspect-ratio-on-a-videodisplay-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/12/30/maintaining-an-videos-aspect-ratio-on-a-videodisplay-control-in-flex/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 04:40:26 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[VideoDisplay]]></category>
		<category><![CDATA[maintainAspectRatio]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/12/30/maintaining-an-videos-aspect-ratio-on-a-videodisplay-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can maintain a loaded video&#8217;s original aspect ratio on a Flex VideoDisplay control by setting the maintainAspectRatio property.</p> <p>Full code after the jump.</p> <p></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/12/30/maintaining-an-videos-aspect-ratio-on-a-videodisplay-control-in-flex/ --&#62; &#60;mx:Application name="VideoDisplay_maintainAspectRatio_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:ApplicationControlBar dock="true"&#62; &#60;mx:Form styleName="plain"&#62; &#60;mx:FormItem label="maintainAspectRatio:"&#62; &#60;mx:CheckBox id="checkBox" /&#62; &#60;/mx:FormItem&#62; &#60;/mx:Form&#62; &#60;/mx:ApplicationControlBar&#62; &#60;mx:VideoDisplay [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can maintain a loaded video&#8217;s original aspect ratio on a Flex VideoDisplay control by setting the <code>maintainAspectRatio</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-918"></span></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/12/30/maintaining-an-videos-aspect-ratio-on-a-videodisplay-control-in-flex/ --&gt;
&lt;mx:Application name="VideoDisplay_maintainAspectRatio_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="maintainAspectRatio:"&gt;
                &lt;mx:CheckBox id="checkBox" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:VideoDisplay id="videoDisplay"
            maintainAspectRatio="{checkBox.selected}"
            source="http://helpexamples.com/flash/video/cuepoints.flv"
            autoPlay="false"
            width="200"
            height="200"
            click="videoDisplay.play();" /&gt;

&lt;/mx:Application&gt;
</pre>
<p>You can also set the <code>maintainAspectRatio</code> property using ActionScript, as seen in the following example:</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/12/30/maintaining-an-videos-aspect-ratio-on-a-videodisplay-control-in-flex/ --&gt;
&lt;mx:Application name="VideoDisplay_maintainAspectRatio_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function checkBox_change(evt:Event):void {
                videoDisplay.maintainAspectRatio = checkBox.selected;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="maintainAspectRatio:"&gt;
                &lt;mx:CheckBox id="checkBox"
                        selected="true"
                        change="checkBox_change(event);" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:VideoDisplay id="videoDisplay"
            source="http://helpexamples.com/flash/video/cuepoints.flv"
            autoPlay="false"
            width="200"
            height="200"
            click="videoDisplay.play();" /&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Maintaining an video\&#039;s aspect ratio on a VideoDisplay control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/12/30/maintaining-an-videos-aspect-ratio-on-a-videodisplay-control-in-flex/',contentID: 'post-918',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'maintainAspectRatio',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/12/30/maintaining-an-videos-aspect-ratio-on-a-videodisplay-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Determining the length of an FLV video using the VideoDisplay control in Flex</title>
		<link>http://blog.flexexamples.com/2008/12/29/determining-the-length-of-an-flv-video-using-the-videodisplay-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/12/29/determining-the-length-of-an-flv-video-using-the-videodisplay-control-in-flex/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 05:15:20 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[VideoDisplay]]></category>
		<category><![CDATA[totalTime]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/12/29/determining-the-length-of-an-flv-video-using-the-videodisplay-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can determine the length of an FLV video (in seconds) using the Flex VideoDisplay control by using the totalTime property.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/12/29/determining-the-length-of-an-flv-video-using-the-videodisplay-control-in-flex/ --&#62; &#60;mx:Application name="VideoDisplay_totalTime_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:ApplicationControlBar dock="true"&#62; &#60;mx:Form styleName="plain"&#62; &#60;mx:FormItem label="totalTime:"&#62; &#60;mx:Label [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can determine the length of an FLV video (in seconds) using the Flex VideoDisplay control by using the <code>totalTime</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-917"></span></p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/12/29/determining-the-length-of-an-flv-video-using-the-videodisplay-control-in-flex/ --&gt;
&lt;mx:Application name="VideoDisplay_totalTime_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="totalTime:"&gt;
                &lt;mx:Label text="{videoDisplay.totalTime}" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:VideoDisplay id="videoDisplay"
            source="http://helpexamples.com/flash/video/cuepoints.flv"
            autoPlay="false"
            click="videoDisplay.play();" /&gt;

&lt;/mx:Application&gt;
</pre>
<p>You can use the <code>totalTime</code> property using ActionScript, as seen in the following example:</p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/12/29/determining-the-length-of-an-flv-video-using-the-videodisplay-control-in-flex/ --&gt;
&lt;mx:Application name="VideoDisplay_totalTime_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="totalTime:"&gt;
                &lt;mx:Label id="lbl" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:VideoDisplay id="videoDisplay"
            source="http://helpexamples.com/flash/video/cuepoints.flv"
            autoPlay="false"
            click="videoDisplay.play();"
            metadataReceived="lbl.text = videoDisplay.totalTime.toString();" /&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Determining the length of an FLV video using the VideoDisplay control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/12/29/determining-the-length-of-an-flv-video-using-the-videodisplay-control-in-flex/',contentID: 'post-917',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'totalTime',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/12/29/determining-the-length-of-an-flv-video-using-the-videodisplay-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Setting a background image on a VideoDisplay control in Flex</title>
		<link>http://blog.flexexamples.com/2008/08/28/setting-a-background-image-on-a-videodisplay-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/08/28/setting-a-background-image-on-a-videodisplay-control-in-flex/#comments</comments>
		<pubDate>Thu, 28 Aug 2008 07:23:46 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[VideoDisplay]]></category>
		<category><![CDATA[backgroundImage]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/28/setting-a-background-image-on-a-videodisplay-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can specify a background image for a Flex VideoDisplay control by setting the backgroundImage style.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/VideoDisplay_backgroundImage_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/08/28/setting-a-background-image-on-a-videodisplay-control-in-flex/ --&#62; &#60;mx:Application name="VideoDisplay_backgroundImage_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Script&#62; &#60;![CDATA[ import mx.events.VideoEvent; import mx.utils.StringUtil; private const src:String = "http://www.helpexamples.com/flash/video/water.flv"; private [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can specify a background image for a Flex VideoDisplay control by setting the <code>backgroundImage</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-775"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/VideoDisplay_backgroundImage_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/28/setting-a-background-image-on-a-videodisplay-control-in-flex/ --&gt;
&lt;mx:Application name="VideoDisplay_backgroundImage_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.events.VideoEvent;
            import mx.utils.StringUtil;

            private const src:String =
                    "http://www.helpexamples.com/flash/video/water.flv";

            private function loadBtn_click(evt:MouseEvent):void {
                videoDisplay.source = src;
            }

            private function playBtn_click(evt:MouseEvent):void {
                videoDisplay.stop();
                videoDisplay.play();
            }

            private function videoDisplay_ready(evt:VideoEvent):void {
                loadBtn.enabled = false;
                playBtn.enabled = true;
            }

            private function videoDisplay_playheadUpdate(evt:VideoEvent):void {
                var playTime:Number = videoDisplay.playheadTime;
                var totTime:Number = videoDisplay.totalTime;
                progressBar.setProgress(playTime, totTime);
                progressBar.label = StringUtil.substitute("{0} of {1}",
                                                    playTime.toFixed(3),
                                                    totTime.toFixed(3));
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Button id="loadBtn"
                label="Load"
                click="loadBtn_click(event);" /&gt;
        &lt;mx:Button id="playBtn"
                label="Play"
                enabled="false"
                click="playBtn_click(event);" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:VideoDisplay id="videoDisplay"
            autoPlay="true"
            backgroundImage="@Embed('Fx2.png')"
            width="230"
            height="220"
            ready="videoDisplay_ready(event);"
            playheadUpdate="videoDisplay_playheadUpdate(event);" /&gt;

    &lt;mx:ProgressBar id="progressBar"
            mode="manual"
            label="{videoDisplay.state}"
            labelPlacement="center"
            width="{videoDisplay.width}" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/VideoDisplay_backgroundImage_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/VideoDisplay_backgroundImage_test/bin/main.html" width="100%" height="350"></iframe></p>
<p>You can also set the <code>backgroundImage</code> style in an external .CSS file or &lt;mx:Style /&gt; block, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/VideoDisplay_backgroundImage_test/bin/srcview/source/main2.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/28/setting-a-background-image-on-a-videodisplay-control-in-flex/ --&gt;
&lt;mx:Application name="VideoDisplay_backgroundImage_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        VideoDisplay {
            backgroundImage: Embed("assets/Fx2.png");
        }
    &lt;/mx:Style&gt;

    &lt;mx:VideoDisplay id="videoDisplay"
            source="http://www.helpexamples.com/flash/video/water.flv"
            autoPlay="true"
            width="230"
            height="220" /&gt;

&lt;/mx:Application&gt;
</pre>
<p>Or, you can set the <code>backgroundImage</code> style using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/VideoDisplay_backgroundImage_test/bin/srcview/source/main3.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/28/setting-a-background-image-on-a-videodisplay-control-in-flex/ --&gt;
&lt;mx:Application name="VideoDisplay_backgroundImage_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        creationComplete="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.controls.VideoDisplay;

            [Embed("assets/Fx2.png")]
            private var flexLogo:Class;

            private var videoDisplay:VideoDisplay;

            private function init():void {
                videoDisplay = new VideoDisplay();
                videoDisplay.autoPlay = true;
                videoDisplay.source = "http://www.helpexamples.com/flash/video/water.flv";
                videoDisplay.width = 230;
                videoDisplay.height = 220;
                videoDisplay.setStyle("backgroundImage", flexLogo);
                addChild(videoDisplay);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting a background image on a VideoDisplay control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/08/28/setting-a-background-image-on-a-videodisplay-control-in-flex/',contentID: 'post-775',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'backgroundImage',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/08/28/setting-a-background-image-on-a-videodisplay-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting the volume on a VideoDisplay control in Flex</title>
		<link>http://blog.flexexamples.com/2008/08/24/setting-the-volume-on-a-videodisplay-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/08/24/setting-the-volume-on-a-videodisplay-control-in-flex/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 06:38:42 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[VideoDisplay]]></category>
		<category><![CDATA[volume]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/24/setting-the-volume-on-a-videodisplay-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can control the volume on a Flex VideoDisplay control by setting the volume property.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/VideoDisplay_volume_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/08/24/setting-the-volume-on-a-videodisplay-control-in-flex/ --&#62; &#60;mx:Application name="VideoDisplay_volume_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:ApplicationControlBar dock="true"&#62; &#60;mx:Form styleName="plain"&#62; &#60;mx:FormItem label="volume:"&#62; &#60;mx:HSlider id="slider" minimum="0.0" maximum="1.0" value="0.7" snapInterval="0.01" tickInterval="0.1" [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can control the volume on a Flex VideoDisplay control by setting the <code>volume</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-762"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/VideoDisplay_volume_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/24/setting-the-volume-on-a-videodisplay-control-in-flex/ --&gt;
&lt;mx:Application name="VideoDisplay_volume_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
         layout="vertical"
         verticalAlign="middle"
         backgroundColor="white"&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="volume:"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="0.0"
                        maximum="1.0"
                        value="0.7"
                        snapInterval="0.01"
                        tickInterval="0.1"
                        liveDragging="true" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:VideoDisplay id="videoDisplay"
            source="http://www.helpexamples.com/flash/video/cuepoints.flv"
            volume="{slider.value}"
            autoPlay="false" /&gt;

    &lt;mx:Button id="playBtn"
            label="Play"
            click="videoDisplay.play();"
            enabled="{!videoDisplay.playing}" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/VideoDisplay_volume_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/VideoDisplay_volume_test/bin/main.html" width="100%" height="350"></iframe></p>
<p>Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/VideoDisplay_volume_test/bin/srcview/source/main2.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/24/setting-the-volume-on-a-videodisplay-control-in-flex/ --&gt;
&lt;mx:Application name="VideoDisplay_volume_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
         layout="vertical"
         verticalAlign="middle"
         backgroundColor="white"
         initialize="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.containers.ApplicationControlBar;
            import mx.containers.Form;
            import mx.containers.FormItem;
            import mx.controls.Button;
            import mx.controls.HSlider;
            import mx.controls.VideoDisplay;
            import mx.controls.sliderClasses.Slider;
            import mx.events.SliderEvent;
            import mx.events.VideoEvent;

            private var slider:HSlider;
            private var videoDisplay:VideoDisplay;
            private var playBtn:Button;

            private function init():void {
                slider = new HSlider();
                slider.minimum = 0.0;
                slider.maximum = 1.0;
                slider.value = 0.7; /* 70% */
                slider.snapInterval = 0.01;
                slider.tickInterval = 0.1;
                slider.liveDragging = true;
                slider.addEventListener(SliderEvent.CHANGE, slider_change);

                videoDisplay = new VideoDisplay();
                videoDisplay.source = "http://www.helpexamples.com/flash/video/cuepoints.flv";
                videoDisplay.volume = slider.value;
                videoDisplay.autoPlay = false;
                videoDisplay.addEventListener(VideoEvent.PLAYHEAD_UPDATE, videoDisplay_playheadUpdate);

                playBtn = new Button();
                playBtn.label = "Play";
                playBtn.enabled = !videoDisplay.playing;
                playBtn.addEventListener(MouseEvent.CLICK, playBtn_click);

                var formItem:FormItem = new FormItem();
                formItem.label = "volume:";
                formItem.addChild(slider);

                var form:Form = new Form();
                form.styleName = "plain";
                form.addChild(formItem);

                var appControlBar:ApplicationControlBar;
                appControlBar = new ApplicationControlBar();
                appControlBar.dock = true;
                appControlBar.addChild(form);
                Application.application.addChildAt(appControlBar, 0);

                addChild(videoDisplay);
                addChild(playBtn);
            }

            private function slider_change(evt:SliderEvent):void {
                videoDisplay.volume = evt.value;
            }

            private function playBtn_click(evt:MouseEvent):void {
                videoDisplay.play();
            }

            private function videoDisplay_playheadUpdate(evt:VideoEvent):void {
                playBtn.enabled = !videoDisplay.playing;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the volume on a VideoDisplay control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/08/24/setting-the-volume-on-a-videodisplay-control-in-flex/',contentID: 'post-762',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'volume',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/08/24/setting-the-volume-on-a-videodisplay-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Displaying a video in a pop up window in Flex</title>
		<link>http://blog.flexexamples.com/2008/08/04/displaying-a-video-in-a-pop-up-window-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/08/04/displaying-a-video-in-a-pop-up-window-in-flex/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 15:14:31 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[PopUpManager]]></category>
		<category><![CDATA[TitleWindow]]></category>
		<category><![CDATA[VideoDisplay]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/04/displaying-a-video-in-a-pop-up-window-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can use the PopUpManager class to display a VideoDisplay control in a TitleWindow container in Flex.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpManager_VideoDisplay_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/08/04/displaying-a-video-in-a-pop-up-window-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="top" backgroundColor="white"&#62; &#60;mx:Script&#62; &#60;![CDATA[ import mx.managers.PopUpManager; private function button_click(evt:MouseEvent):void { var popUpVideoDisplay:PopUpVideoDisplay; popUpVideoDisplay = [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use the PopUpManager class to display a VideoDisplay control in a TitleWindow container in Flex.</p>
<p>Full code after the jump.</p>
<p><span id="more-730"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpManager_VideoDisplay_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/04/displaying-a-video-in-a-pop-up-window-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="top"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.managers.PopUpManager;

            private function button_click(evt:MouseEvent):void {
                var popUpVideoDisplay:PopUpVideoDisplay;
                popUpVideoDisplay = new PopUpVideoDisplay();
                popUpVideoDisplay.source = "http://www.helpexamples.com/flash/video/water.flv";
                PopUpManager.addPopUp(popUpVideoDisplay, this, true);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Button id="button"
            label="Launch video"
            click="button_click(event);" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpManager_VideoDisplay_test/bin/srcview/source/PopUpVideoDisplay.mxml.html">PopUpVideoDisplay.mxml</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/04/displaying-a-video-in-a-pop-up-window-in-flex/ --&gt;
&lt;mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
        showCloseButton="true"
        styleName="noPadding"
        creationComplete="init();"
        close="titleWindow_close(event);"&gt;

    &lt;mx:Style&gt;
        .noPadding {
            paddingBottom: 0;
            paddingTop: 0;
            paddingLeft: 0;
            paddingRight: 0;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.managers.IFocusManagerComponent;
            import mx.controls.Alert;
            import mx.core.IFlexDisplayObject;
            import mx.events.CloseEvent;
            import mx.managers.PopUpManager;

            [Bindable]
            public var source:String;

            private function init():void {
                PopUpManager.centerPopUp(this);
            }

            private function titleWindow_close(evt:CloseEvent):void {
                PopUpManager.removePopUp(evt.target as IFlexDisplayObject);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:VideoDisplay id="videoDisplay"
            source="{source}"
            resize="init();" /&gt;

    &lt;mx:ControlBar horizontalAlign="right" width="100%"&gt;
    &lt;/mx:ControlBar&gt;

&lt;/mx:TitleWindow&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/PopUpManager_VideoDisplay_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/PopUpManager_VideoDisplay_test/bin/main.html" width="100%" height="350"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Displaying a video in a pop up window in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/08/04/displaying-a-video-in-a-pop-up-window-in-flex/',contentID: 'post-730',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: '',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/08/04/displaying-a-video-in-a-pop-up-window-in-flex/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Setting the background alpha on a VideoDisplay control in Flex</title>
		<link>http://blog.flexexamples.com/2008/04/18/setting-the-background-alpha-on-a-videodisplay-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/04/18/setting-the-background-alpha-on-a-videodisplay-control-in-flex/#comments</comments>
		<pubDate>Sat, 19 Apr 2008 02:57:46 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[VideoDisplay]]></category>
		<category><![CDATA[backgroundAlpha]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/18/setting-the-background-alpha-on-a-videodisplay-control-in-flex/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/04/18/setting-the-background-color-on-a-videodisplay-control-in-flex/">&#8220;Setting the background color on a VideoDisplay control in Flex&#8221;</a>, we saw how you could modify the background color of a VideoDisplay control in Flex by setting the backgroundColor style.</p> <p>The following example shows how you can set the background alpha on a Flex VideoDisplay control by setting the backgroundAlpha [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/04/18/setting-the-background-color-on-a-videodisplay-control-in-flex/">&#8220;Setting the background color on a VideoDisplay control in Flex&#8221;</a>, we saw how you could modify the background color of a VideoDisplay control in Flex by setting the <code>backgroundColor</code> style.</p>
<p>The following example shows how you can set the background alpha on a Flex VideoDisplay control by setting the <code>backgroundAlpha</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-597"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/VideoDisplay_backgroundAlpha_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/04/18/setting-the-background-alpha-on-a-videodisplay-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function loadButton_click(evt:MouseEvent):void {
                var url:String = "http://www.helpexamples.com/flash/video/clouds.flv";
                videoDisplay.source = url;
            }

            private function unloadButton_click(evt:MouseEvent):void {
                videoDisplay.close();
                videoDisplay.source = null;
                videoDisplay.mx_internal::videoPlayer.clear();
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="backgroundAlpha:"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="0.0"
                        maximum="1.0"
                        value="1"
                        snapInterval="0.01"
                        liveDragging="true" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="backgroundColor:"&gt;
                &lt;mx:ColorPicker id="colorPicker" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:VideoDisplay id="videoDisplay"
            backgroundAlpha="{slider.value}"
            backgroundColor="{colorPicker.selectedColor}"
            width="160"
            height="120" /&gt;

    &lt;mx:ControlBar&gt;
        &lt;mx:Button id="loadButton"
                label="Load"
                click="loadButton_click(event);" /&gt;
        &lt;mx:Button id="unloadButton"
                label="Unload"
                click="unloadButton_click(event);" /&gt;
    &lt;/mx:ControlBar&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/VideoDisplay_backgroundAlpha_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/VideoDisplay_backgroundAlpha_test/bin/main.html" width="100%" height="280"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the background alpha on a VideoDisplay control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/04/18/setting-the-background-alpha-on-a-videodisplay-control-in-flex/',contentID: 'post-597',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'backgroundAlpha',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/04/18/setting-the-background-alpha-on-a-videodisplay-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting the background color on a VideoDisplay control in Flex</title>
		<link>http://blog.flexexamples.com/2008/04/18/setting-the-background-color-on-a-videodisplay-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/04/18/setting-the-background-color-on-a-videodisplay-control-in-flex/#comments</comments>
		<pubDate>Sat, 19 Apr 2008 02:44:49 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[VideoDisplay]]></category>
		<category><![CDATA[backgroundColor]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/18/setting-the-background-color-on-a-videodisplay-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can modify the background color of a Flex VideoDisplay control by setting the backgroundColor style.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/VideoDisplay_backgroundColor_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/04/18/setting-the-background-color-on-a-videodisplay-control-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Script&#62; &#60;![CDATA[ private function loadButton_click(evt:MouseEvent):void { var url:String = "http://www.helpexamples.com/flash/video/clouds.flv"; videoDisplay.source = url; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can modify the background color of a Flex VideoDisplay control by setting the <code>backgroundColor</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-596"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/VideoDisplay_backgroundColor_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/04/18/setting-the-background-color-on-a-videodisplay-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function loadButton_click(evt:MouseEvent):void {
                var url:String = "http://www.helpexamples.com/flash/video/clouds.flv";
                videoDisplay.source = url;
            }

            private function unloadButton_click(evt:MouseEvent):void {
                videoDisplay.close();
                videoDisplay.source = null;
                videoDisplay.mx_internal::videoPlayer.clear();
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="backgroundColor:"&gt;
                &lt;mx:ColorPicker id="colorPicker" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:VideoDisplay id="videoDisplay"
            backgroundColor="{colorPicker.selectedColor}"
            width="160"
            height="120" /&gt;

    &lt;mx:ControlBar&gt;
        &lt;mx:Button id="loadButton"
                label="Load"
                click="loadButton_click(event);" /&gt;
        &lt;mx:Button id="unloadButton"
                label="Unload"
                click="unloadButton_click(event);" /&gt;
    &lt;/mx:ControlBar&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/VideoDisplay_backgroundColor_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/VideoDisplay_backgroundColor_test/bin/main.html" width="100%" height="260"></iframe></p>
<p>You can also set the <code>backgroundColor</code> style in an external .CSS file or in an &lt;mx:Style /&gt; block, as seen in the following snippet:</p>
<pre class="code">
&lt;mx:Style&gt;
    VideoDisplay {
        backgroundColor: red;
    }
&lt;/mx:Style&gt;
</pre>
<p>Or, you could set the <code>backgroundColor</code> style using ActionScript, as seen in the following snippet:</p>
<pre class="code">
videoDisplay.setStyle("backgroundColor", "red");
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the background color on a VideoDisplay control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/04/18/setting-the-background-color-on-a-videodisplay-control-in-flex/',contentID: 'post-596',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'backgroundColor',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/04/18/setting-the-background-color-on-a-videodisplay-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Detecting changes in a camera&#8217;s activity and status in a Flex VideoDisplay control</title>
		<link>http://blog.flexexamples.com/2008/01/22/detecting-changes-in-a-cameras-activity-and-status-in-a-flex-videodisplay-control/</link>
		<comments>http://blog.flexexamples.com/2008/01/22/detecting-changes-in-a-cameras-activity-and-status-in-a-flex-videodisplay-control/#comments</comments>
		<pubDate>Wed, 23 Jan 2008 05:49:20 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Camera]]></category>
		<category><![CDATA[VideoDisplay]]></category>
		<category><![CDATA[activity]]></category>
		<category><![CDATA[attachCamera()]]></category>
		<category><![CDATA[getCamera()]]></category>
		<category><![CDATA[status]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/22/detecting-changes-in-a-cameras-activity-and-status-in-a-flex-videodisplay-control/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/01/22/displaying-a-webcams-video-in-a-flex-videodisplay-control/">&#8220;Displaying a webcam&#8217;s video in a Flex VideoDisplay control&#8221;</a>, we saw how to connect to a user&#8217;s webcam, if they have one installed.</p> <p>In the following example we see how to listen for the Camera object&#8217;s activity event and status event, using some good ol&#8217; ActionScript.</p> <p>Full code after the [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/01/22/displaying-a-webcams-video-in-a-flex-videodisplay-control/">&#8220;Displaying a webcam&#8217;s video in a Flex VideoDisplay control&#8221;</a>, we saw how to connect to a user&#8217;s webcam, if they have one installed.</p>
<p>In the following example we see how to listen for the Camera object&#8217;s activity event and status event, using some good ol&#8217; ActionScript.</p>
<p>Full code after the jump.</p>
<p><span id="more-468"></span></p>
<p class="alert">This example won’t be very interesting unless you actually have a webcam installed.</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/VideoDisplay_attachCamera_status_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/01/22/detecting-changes-in-a-cameras-activity-and-status-in-a-flex-videodisplay-control/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="horizontal"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.controls.Alert;
            import mx.utils.StringUtil;

            private function videoDisplay_creationComplete():void {
                var camera:Camera = Camera.getCamera();
                if (camera) {
                    videoDisplay.attachCamera(camera);
                    camera.addEventListener(ActivityEvent.ACTIVITY, camera_activity);
                    camera.addEventListener(StatusEvent.STATUS, camera_status);
                } else {
                    Alert.show("You don't seem to have a camera.");
                }
            }

            private function camera_activity(evt:ActivityEvent):void {
                var str:String = "[{0}] activating:{1}\\n";
                textArea.text += StringUtil.substitute(str,
                                    evt.type,
                                    evt.activating);
            }

            private function camera_status(evt:StatusEvent):void {
                var str:String = "[{0}] code:'{1}', level:'{2}'\\n";
                textArea.text += StringUtil.substitute(str,
                                    evt.type,
                                    evt.code,
                                    evt.level);
                switch (evt.code) {
                    case "Camera.Muted":
                        Alert.show("User denied access to camera.");
                        break;
                    case "Camera.Unmuted":
                        Alert.show("User allowed access to camera.");
                        break;
                }
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:VideoDisplay id="videoDisplay"
            creationComplete="videoDisplay_creationComplete();"
            width="160"
            height="120" /&gt;

    &lt;mx:TextArea id="textArea"
            editable="false"
            width="100%"
            height="{videoDisplay.height}"
            wordWrap="false"
            verticalScrollPolicy="on" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/VideoDisplay_attachCamera_status_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/VideoDisplay_attachCamera_status_test/bin/main.html" width="100%" height="250"></iframe></p>
<p>If you want to display the Adobe Flash Player Settings dialog box again, you can use the following ActionScript:</p>
<pre class="code">
Security.showSettings(SecurityPanel.PRIVACY);
</pre>
<p>You can also allow users to go to different tabs in the Settings dialog by by using something similar to the following snippet:</p>
<pre class="code">
&lt;mx:ApplicationControlBar dock="true"&gt;
    &lt;mx:Button label="Camera"
            click="Security.showSettings(SecurityPanel.CAMERA);" /&gt;
    &lt;mx:Button label="Privacy"
            click="Security.showSettings(SecurityPanel.PRIVACY);" /&gt;
&lt;/mx:ApplicationControlBar&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Detecting changes in a camera\&#039;s activity and status in a Flex VideoDisplay control on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/22/detecting-changes-in-a-cameras-activity-and-status-in-a-flex-videodisplay-control/',contentID: 'post-468',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'activity,attachCamera(),getCamera(),status',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/01/22/detecting-changes-in-a-cameras-activity-and-status-in-a-flex-videodisplay-control/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

