<?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; UIComponent</title>
	<atom:link href="http://blog.flexexamples.com/category/uicomponent/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>Using the Flash FLVPlayback control in Flex</title>
		<link>http://blog.flexexamples.com/2008/12/11/using-the-flash-flvplayback-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/12/11/using-the-flash-flvplayback-control-in-flex/#comments</comments>
		<pubDate>Fri, 12 Dec 2008 07:31:02 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash Integration]]></category>
		<category><![CDATA[FLVPlayback]]></category>
		<category><![CDATA[UIComponent]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/12/11/using-the-flash-flvplayback-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can use the Flash FLVPlayback component that ships with Flash CS3 and Flash CS4 by copying the FLVPlaybackAS3.swc file into your Flex project&#8217;s /libs/ folder.</p> <p>Full code after the jump.</p> <p></p> <p>Flash CS3<br /> PC: \Adobe Flash CS3\en\Configuration\Components\Video\FLVPlaybackAS3.swc</p> <p>Flash CS4<br /> PC: \Adobe Flash CS4\Common\Configuration\Components\Video\FLVPlaybackAS3.swc</p> <p class="download"><a href="">View MXML</a></p> [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use the Flash FLVPlayback component that ships with Flash CS3 and Flash CS4 by copying the FLVPlaybackAS3.swc file into your Flex project&#8217;s /libs/ folder.</p>
<p>Full code after the jump.</p>
<p><span id="more-897"></span></p>
<p><strong>Flash CS3</strong><br />
PC: \Adobe Flash CS3\en\Configuration\Components\Video\FLVPlaybackAS3.swc</p>
<p><strong>Flash CS4</strong><br />
PC: \Adobe Flash CS4\Common\Configuration\Components\Video\FLVPlaybackAS3.swc</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/11/using-the-flash-flvplayback-control-in-flex/ --&gt;
&lt;mx:Application name="FLVPlayback_MXML_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        xmlns:video="fl.video.*"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function flvPlayback_autoLayout(evt:Event):void {
                videoHolder.width = flvPlayback.width;
                videoHolder.height = flvPlayback.height;
                flvPlayback.x = 0;
                flvPlayback.y = 0;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;video:FLVPlayback id="flvPlayback"
            source="http://www.helpexamples.com/flash/video/caption_video.flv"
            scaleMode="maintainAspectRatio"
            skin="SkinOverPlaySeekMute.swf"
            skinAutoHide="true"
            autoLayout="flvPlayback_autoLayout(event);" /&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Button id="btn"
                label="Play Video"
                click="videoHolder.addChild(flvPlayback);" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Panel backgroundColor="red"&gt;
        &lt;mx:UIComponent id="videoHolder" /&gt;
    &lt;/mx:Panel&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Using the Flash FLVPlayback control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/12/11/using-the-flash-flvplayback-control-in-flex/',contentID: 'post-897',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/12/11/using-the-flash-flvplayback-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Positioning items in Flex using a constraint based layout</title>
		<link>http://blog.flexexamples.com/2007/09/26/positioning-items-in-flex-using-a-constraint-based-layout/</link>
		<comments>http://blog.flexexamples.com/2007/09/26/positioning-items-in-flex-using-a-constraint-based-layout/#comments</comments>
		<pubDate>Thu, 27 Sep 2007 03:33:49 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Image]]></category>
		<category><![CDATA[Styles]]></category>
		<category><![CDATA[UIComponent]]></category>
		<category><![CDATA[bottom]]></category>
		<category><![CDATA[horizontalCenter]]></category>
		<category><![CDATA[left]]></category>
		<category><![CDATA[right]]></category>
		<category><![CDATA[top]]></category>
		<category><![CDATA[verticalCenter]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/26/positioning-items-in-flex-using-a-constraint-based-layout/</guid>
		<description><![CDATA[<p>The following examples show how you can position items in an absolute-based layout using the top, bottom, left, right, horizontalCenter, and verticalCenter styles.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Image_bottom_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2007/09/26/positioning-items-in-flex-using-a-constraint-based-layout/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Style&#62; .bugImage { bottom: 20; right: 20; } &#60;/mx:Style&#62; &#60;mx:Canvas id="canvas" [...]]]></description>
			<content:encoded><![CDATA[<p>The following examples show how you can position items in an absolute-based layout using the <code>top</code>, <code>bottom</code>, <code>left</code>, <code>right</code>, <code>horizontalCenter</code>, and <code>verticalCenter</code> styles.</p>
<p>Full code after the jump.</p>
<p><span id="more-211"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Image_bottom_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/09/26/positioning-items-in-flex-using-a-constraint-based-layout/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        .bugImage {
            bottom: 20;
            right: 20;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Canvas id="canvas"
            backgroundColor="black"
            backgroundAlpha="0.4"
            width="100%"
            height="100%"&gt;
        &lt;mx:Image source="assets/bug.png"
                styleName="bugImage" /&gt;
    &lt;/mx:Canvas&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Image_bottom_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/Image_bottom_test/bin/main.html" width="100%" height="250"></iframe></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Image_left_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/09/26/positioning-items-in-flex-using-a-constraint-based-layout/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

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

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.events.SliderEvent;

            private function sliderLeft_change(evt:SliderEvent):void {
                image.setStyle("left", sliderLeft.value);
                image.setStyle("right", NaN);
                sliderRight.value = 0;
            }

            private function sliderRight_change(evt:SliderEvent):void {
                image.setStyle("right", sliderRight.value);
                image.setStyle("left", NaN);
                sliderLeft.value = 0;
            }

            private function sliderTop_change(evt:SliderEvent):void {
                image.setStyle("top", sliderTop.value);
                image.setStyle("bottom", NaN);
                sliderBottom.value = 0;
            }

            private function sliderBottom_change(evt:SliderEvent):void {
                image.setStyle("bottom", sliderBottom.value);
                image.setStyle("top", NaN);
                sliderTop.value = 0;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Number id="MAX_WIDTH"&gt;{canvas.width - image.width}&lt;/mx:Number&gt;
    &lt;mx:Number id="MAX_HEIGHT"&gt;{canvas.height - image.height}&lt;/mx:Number&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form&gt;
            &lt;mx:FormItem label="left:" direction="horizontal"&gt;
                &lt;mx:HSlider id="sliderLeft"
                        minimum="0"
                        maximum="{MAX_WIDTH}"
                        value="0"
                        liveDragging="true"
                        snapInterval="1"
                        dataTipPrecision="0"
                        showTrackHighlight="true"
                        change="sliderLeft_change(event);" /&gt;
                &lt;mx:Label text="{sliderLeft.value}" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="right:" direction="horizontal"&gt;
                &lt;mx:HSlider id="sliderRight"
                        minimum="0"
                        maximum="{MAX_WIDTH}"
                        value="0"
                        liveDragging="true"
                        snapInterval="1"
                        dataTipPrecision="0"
                        showTrackHighlight="true"
                        change="sliderRight_change(event);" /&gt;
                &lt;mx:Label text="{sliderRight.value}" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="top:" direction="horizontal"&gt;
                &lt;mx:HSlider id="sliderTop"
                        minimum="0"
                        maximum="{MAX_HEIGHT}"
                        liveDragging="true"
                        snapInterval="1"
                        dataTipPrecision="0"
                        showTrackHighlight="true"
                        change="sliderTop_change(event);" /&gt;
                &lt;mx:Label text="{sliderTop.value}" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="bottom:" direction="horizontal"&gt;
                &lt;mx:HSlider id="sliderBottom"
                        minimum="0"
                        maximum="{MAX_HEIGHT}"
                        liveDragging="true"
                        snapInterval="1"
                        dataTipPrecision="0"
                        showTrackHighlight="true"
                        change="sliderBottom_change(event);" /&gt;
                &lt;mx:Label text="{sliderBottom.value}" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Canvas id="canvas" width="100%" height="100%"&gt;
        &lt;mx:Image id="image"
                source="assets/bug.png"/&gt;
    &lt;/mx:Canvas&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Image_left_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/Image_left_test/bin/main.html" width="100%" height="350"></iframe></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Image_verticalCenter_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/09/26/positioning-items-in-flex-using-a-constraint-based-layout/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Number id="HORIZONTAL_MAX"&gt;
        {int((canvas.width - image.width) / 2)}
    &lt;/mx:Number&gt;
    &lt;mx:Number id="VERTICAL_MAX"&gt;
        {int((canvas.height - image.height) / 2)}
    &lt;/mx:Number&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form&gt;
            &lt;mx:FormItem label="horizontalCenter:"
                    direction="horizontal"&gt;
                &lt;mx:HSlider id="hSlider"
                        minimum="{-HORIZONTAL_MAX}"
                        maximum="{HORIZONTAL_MAX}"
                        liveDragging="true"
                        snapInterval="1"
                        dataTipPrecision="0" /&gt;
                &lt;mx:Label text="{hSlider.value}" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="verticalCenter:"
                    direction="horizontal"&gt;
                &lt;mx:HSlider id="vSlider"
                        minimum="{-VERTICAL_MAX}"
                        maximum="{VERTICAL_MAX}"
                        liveDragging="true"
                        snapInterval="1"
                        dataTipPrecision="0" /&gt;
                &lt;mx:Label text="{vSlider.value}" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Canvas id="canvas"
            backgroundColor="black"
            backgroundAlpha="0.2"
            width="100%"
            height="100%"&gt;
        &lt;mx:Image id="image"
                source="assets/bug.png"
                verticalCenter="{vSlider.value}"
                horizontalCenter="{hSlider.value}" /&gt;
    &lt;/mx:Canvas&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Image_verticalCenter_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/Image_verticalCenter_test/bin/main.html" width="100%" height="350"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Positioning items in Flex using a constraint based layout on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/09/26/positioning-items-in-flex-using-a-constraint-based-layout/',contentID: 'post-211',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'bottom,horizontalCenter,left,right,top,verticalCenter',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/2007/09/26/positioning-items-in-flex-using-a-constraint-based-layout/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

