<?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>Serge Jespers &#187; component</title>
	<atom:link href="http://www.webkitchen.be/tag/component/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webkitchen.be</link>
	<description>Life as an Adobe platform evangelist</description>
	<lastBuildDate>Tue, 31 Jan 2012 17:35:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Video tutorial: Use the Flex webservice component in Flash CS4 projects</title>
		<link>http://www.webkitchen.be/2009/03/02/video-tutorial-use-the-flex-webservice-component-in-flash-cs4-projects/</link>
		<comments>http://www.webkitchen.be/2009/03/02/video-tutorial-use-the-flex-webservice-component-in-flash-cs4-projects/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 12:23:18 +0000</pubDate>
		<dc:creator>Serge Jespers</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[Video Tutorial]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[webservice]]></category>

		<guid isPermaLink="false">http://www.webkitchen.be/?p=924</guid>
		<description><![CDATA[In this video, I&#8217;ll show you how you can use the webservice component from the Flex framework in your Flash CS4 projects. If you&#8217;re missing the webservice component in Flash, just use the one in the Flex framework. UPDATE: My sincere apologies. There is an error in my code which I did not explain in [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.webkitchen.be%2F2009%2F03%2F02%2Fvideo-tutorial-use-the-flex-webservice-component-in-flash-cs4-projects%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.webkitchen.be%2F2009%2F03%2F02%2Fvideo-tutorial-use-the-flex-webservice-component-in-flash-cs4-projects%2F&amp;source=sjespers&amp;style=normal&amp;service=bit.ly&amp;service_api=R_f11b21ad05448f9b4029b73b124e8d0e&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>In this video, I&#8217;ll show you how you can use the webservice component from the Flex framework in your Flash CS4 projects. If you&#8217;re missing the webservice component in Flash, just use the one in the Flex framework.  <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="361" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=3434660&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=B7C70F&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="640" height="361" src="http://vimeo.com/moogaloop.swf?clip_id=3434660&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=B7C70F&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>UPDATE: My sincere apologies. There is an error in my code which I did not explain in the video.<br />
Line 10 should not read myWebService.load but myWebService.loadWSDL.</p>
<p>I do remember we recorded this one twice and I fear that that&#8217;s where the mixup happened. Please download the working FLA below.</p>
<p><a href="http://www.webkitchen.be/wp-content/uploads/2009/03/webservice.zip">Download</a> the FLA file.</p>
<iframe id="basic_facebook_social_plugins_likebutton" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.webkitchen.be%2F2009%2F03%2F02%2Fvideo-tutorial-use-the-flex-webservice-component-in-flash-cs4-projects%2F&amp;layout=standard&amp;show_faces=true&amp;width=500&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:500px; height:75px"></iframe>]]></content:encoded>
			<wfw:commentRss>http://www.webkitchen.be/2009/03/02/video-tutorial-use-the-flex-webservice-component-in-flash-cs4-projects/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Video tutorial: Create Flex container components with Flash CS4</title>
		<link>http://www.webkitchen.be/2009/02/11/video-tutorial-create-flex-container-components-with-flash-cs4/</link>
		<comments>http://www.webkitchen.be/2009/02/11/video-tutorial-create-flex-container-components-with-flash-cs4/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 10:56:03 +0000</pubDate>
		<dc:creator>Serge Jespers</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[Popular]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[Video Tutorial]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[component kit]]></category>
		<category><![CDATA[containers]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[flex component kit for flash]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.webkitchen.be/?p=857</guid>
		<description><![CDATA[In this video I show you how to make a Flex container component with Flash CS4 and the Flex Component Kit for Flash. The Flex Component Kit for Flash is incredibly powerful and allows you to combine your Flash design/development skills with the power of the Flex framework. Subscribe to the Adobe Developer Connection videos [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.webkitchen.be%2F2009%2F02%2F11%2Fvideo-tutorial-create-flex-container-components-with-flash-cs4%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.webkitchen.be%2F2009%2F02%2F11%2Fvideo-tutorial-create-flex-container-components-with-flash-cs4%2F&amp;source=sjespers&amp;style=normal&amp;service=bit.ly&amp;service_api=R_f11b21ad05448f9b4029b73b124e8d0e&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>In this video I show you how to make a Flex container component with Flash CS4 and the Flex Component Kit for Flash.</p>
<p><object width="640" height="368"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=3484055&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=B7C70F&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=3484055&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=B7C70F&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="640" height="368"></embed></object></p>
<p>The <a href="http://www.adobe.com/cfusion/entitlement/index.cfm?e=flex_skins#fxcompkit" target="_blank">Flex Component Kit for Flash</a> is incredibly powerful and allows you to combine your Flash design/development skills with the power of the Flex framework.</p>
<p><a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=299639895" target="_blank">Subscribe</a> to the Adobe Developer Connection videos on iTunes.</p>
<iframe id="basic_facebook_social_plugins_likebutton" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.webkitchen.be%2F2009%2F02%2F11%2Fvideo-tutorial-create-flex-container-components-with-flash-cs4%2F&amp;layout=standard&amp;show_faces=true&amp;width=500&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:500px; height:75px"></iframe>]]></content:encoded>
			<wfw:commentRss>http://www.webkitchen.be/2009/02/11/video-tutorial-create-flex-container-components-with-flash-cs4/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Video tutorial: Add video to your Flex application</title>
		<link>http://www.webkitchen.be/2009/01/06/video-tutorial-add-video-to-your-flex-application/</link>
		<comments>http://www.webkitchen.be/2009/01/06/video-tutorial-add-video-to-your-flex-application/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 07:29:57 +0000</pubDate>
		<dc:creator>Serge Jespers</dc:creator>
				<category><![CDATA[flash video]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[Video Tutorial]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.webkitchen.be/?p=699</guid>
		<description><![CDATA[In this video I show you how to add a simple video player to your Flex application by using nothing but standard Flex components.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.webkitchen.be%2F2009%2F01%2F06%2Fvideo-tutorial-add-video-to-your-flex-application%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.webkitchen.be%2F2009%2F01%2F06%2Fvideo-tutorial-add-video-to-your-flex-application%2F&amp;source=sjespers&amp;style=normal&amp;service=bit.ly&amp;service_api=R_f11b21ad05448f9b4029b73b124e8d0e&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>In this video I show you how to add a simple video player to your Flex application by using nothing but standard Flex components.<br/><br />
<object width="640" height="368"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=3484122&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=B7C70F&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=3484122&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=B7C70F&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="640" height="368"></embed></object></p>
<iframe id="basic_facebook_social_plugins_likebutton" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.webkitchen.be%2F2009%2F01%2F06%2Fvideo-tutorial-add-video-to-your-flex-application%2F&amp;layout=standard&amp;show_faces=true&amp;width=500&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:500px; height:75px"></iframe>]]></content:encoded>
			<wfw:commentRss>http://www.webkitchen.be/2009/01/06/video-tutorial-add-video-to-your-flex-application/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Weekly Roundup: May 4th &#8211; May 10th</title>
		<link>http://www.webkitchen.be/2008/05/10/weekly-roundup/</link>
		<comments>http://www.webkitchen.be/2008/05/10/weekly-roundup/#comments</comments>
		<pubDate>Sat, 10 May 2008 11:43:58 +0000</pubDate>
		<dc:creator>Serge Jespers</dc:creator>
				<category><![CDATA[Roundup]]></category>
		<category><![CDATA[Weekly blend]]></category>
		<category><![CDATA[adobe usergroup]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[aug]]></category>
		<category><![CDATA[charting]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[elixir]]></category>
		<category><![CDATA[fedex]]></category>
		<category><![CDATA[ilog]]></category>
		<category><![CDATA[led screen]]></category>
		<category><![CDATA[moon]]></category>
		<category><![CDATA[multi-mania]]></category>
		<category><![CDATA[mxna]]></category>
		<category><![CDATA[nasa]]></category>
		<category><![CDATA[pixel art]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[user interface]]></category>

		<guid isPermaLink="false">http://www.webkitchen.be/?p=107</guid>
		<description><![CDATA[As last week, this is just a collection of blog posts and sites that caught my attention this week. Send your name to the moon: NASA is sending an unmanned mission to the moon and you can be part of it&#8230; well&#8230; Your name can be part of it but that&#8217;s still cool [link] Spam [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.webkitchen.be%2F2008%2F05%2F10%2Fweekly-roundup%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.webkitchen.be%2F2008%2F05%2F10%2Fweekly-roundup%2F&amp;source=sjespers&amp;style=normal&amp;service=bit.ly&amp;service_api=R_f11b21ad05448f9b4029b73b124e8d0e&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>As last week, this is just a collection of blog posts and sites that caught my attention this week.</p>
<ul>
<li><strong>Send your name to the moon</strong>: NASA is sending an unmanned mission to the moon and you can be part of it&#8230; well&#8230; Your name can be part of it but that&#8217;s still cool [<a href="http://www.nasa.gov/mission_pages/LRO/news/nametomoon.html" target="_blank">link</a>]</li>
<li><strong>Spam 30 years old</strong>: The first spam message was sent on Arpanet on May 3rd, 1978 [<a href="http://www.crunchgear.com/2008/05/04/happy-belated-30th-birthday-spam/" target="_blank">link</a>]</li>
<li><strong>Giant solar powered LED screen in Bejing</strong> [<a href="http://gizmodo.com/386925/beijings-gigantic-led-wall-is-fully-solar-powered" target="_blank">link</a>]</li>
<li><strong>A celebration of Pixel Art</strong>: Smashing Magazine has a great collection of Pixel Art which includes the AIR launch poster by Eboy [<a href="http://www.smashingmagazine.com/2008/05/05/pixels-go-mad-the-celebration-of-pixel-art/" target="_blank">link</a>]</li>
<li><strong>MXNA is back</strong> [<a href="http://feeds.adobe.com/" target="_blank">link</a>]</li>
<li><strong>Hydra is now Pixel Bender</strong> [<a href="http://blogs.adobe.com/kevin.goldsmith/2008/05/hydra_is_now_pi.html" target="_blank">link</a>]</li>
<li><strong>Interactive demos of ILOG Elixir charting components for Flex</strong>: If you&#8217;re looking for sophisticated data visualization for Flex, don&#8217;t look any further [<a href="http://gregorywilson.wordpress.com/2008/05/07/interactive-demos-of-ilog-elixir-flex-components/" target="_blank">link</a>]</li>
<li><strong>FedEx Desktop released</strong>: Now you can follow your FedEx shipments with an AIR app [<a href="http://www.fedex.com/desktop/" target="_blank">link</a>]</li>
<li><strong>Living in The Netherlands? Take the bus to Multi-Mania.</strong> The Dutch Adobe UserGroup is organizing a bustrip to Multi-Mania. [<a href="http://www.unitzeroone.com/blog/2008/05/09/bustrip-to-multimania-still-places-left/trackback/" target="_blank">link</a>]</li>
<li><strong>The User Interface Resource Center</strong>:&nbsp;The User Interface Resource Center (UIRC) provides free articles and White Papers written by industry leaders about user interface design and rich Internet applications (RIAs) [<a href="http://www.uiresourcecenter.com/" target="_blank">link</a>]</li>
</ul>
<iframe id="basic_facebook_social_plugins_likebutton" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.webkitchen.be%2F2008%2F05%2F10%2Fweekly-roundup%2F&amp;layout=standard&amp;show_faces=true&amp;width=500&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:500px; height:75px"></iframe>]]></content:encoded>
			<wfw:commentRss>http://www.webkitchen.be/2008/05/10/weekly-roundup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial: The Flash and Flex marriage</title>
		<link>http://www.webkitchen.be/2008/05/05/the-flash-and-flex-marriage/</link>
		<comments>http://www.webkitchen.be/2008/05/05/the-flash-and-flex-marriage/#comments</comments>
		<pubDate>Mon, 05 May 2008 05:50:51 +0000</pubDate>
		<dc:creator>Serge Jespers</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[combination]]></category>
		<category><![CDATA[combine]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[flvplayback]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.webkitchen.be/?p=95</guid>
		<description><![CDATA[One of the things I hear a lot is that people really miss the Flash media components when they&#8217;re diving in to Flex. So why not use that component you love so much in your Flex projects? &#8220;The Flex component kit for Flash&#8221; has been out there for a while now and if you have [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.webkitchen.be%2F2008%2F05%2F05%2Fthe-flash-and-flex-marriage%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.webkitchen.be%2F2008%2F05%2F05%2Fthe-flash-and-flex-marriage%2F&amp;source=sjespers&amp;style=normal&amp;service=bit.ly&amp;service_api=R_f11b21ad05448f9b4029b73b124e8d0e&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>One of the things I hear a lot is that people really miss the Flash media components when they&#8217;re diving in to Flex. So why not use that component you love so much in your Flex projects? &#8220;The Flex component kit for Flash&#8221; has been out there for a while now and if you have all the latest updates to Flash, it&#8217;s even part of your Flash CS3 authoring environment by default now. I have the feeling people underestimate this feature and don&#8217;t really appreciate the power of this yet. So I thought it was a good idea to create a little tutorial to show you how easy it is to make Flex components in Flash CS3 and in this case, how to use the Flash media components inside your Flex projects.</p>
<p>So we&#8217;re going to create a Flex component that holds the FLVPlayback component and write a little bit of ActionScript to make it work in Flex. Let me know if this was useful for you.<br />
<span id="more-95"></span><br />
First thing you need to check is that your Flash CS3 authoring is up to date. If it is, your commands menu should look like this:</p>
<p style="text-align: center;"><img class="alignnone size-full wp-image-88 aligncenter" title="commands menu" src="http://www.webkitchen.be/wp-content/uploads/2008/04/commands.jpg" alt="" width="335" height="252" /></p>
<p>If your Commands menu looks different, make sure you click the &#8220;Updates&#8230;&#8221; option in the Help menu to get all the latest updates or download the commands from <a href="http://www.adobe.com/go/flex3_cs3_swfkit" target="_blank">http://www.adobe.com/go/flex3_cs3_swfkit</a></p>
<p>Make a new Flash document and drag and drop the &#8220;FLVPlayback&#8221; component from the component panel to the stage.</p>
<p style="text-align: center;"><img class="alignnone size-full wp-image-89 aligncenter" title="Component panel" src="http://www.webkitchen.be/wp-content/uploads/2008/04/2_components.jpg" alt="" width="343" height="345" /></p>
<p>Make sure you specify an instance name for that component. I&#8217;m calling mine &#8220;MyPlayer&#8221;.</p>
<p style="text-align: center;"><img class="alignnone size-full wp-image-90 aligncenter" title="3_instance_name" src="http://www.webkitchen.be/wp-content/uploads/2008/04/3_instance_name.jpg" alt="" width="336" height="123" /></p>
<p>Next, make a movieclip from that FLVPlayback component. I&#8217;m going to call mine &#8220;MyVideoPlayer&#8221;.</p>
<p style="text-align: center;"><img class="alignnone size-full wp-image-91 aligncenter" title="4_movieclip" src="http://www.webkitchen.be/wp-content/uploads/2008/04/4_movieclip.jpg" alt="" width="450" height="136" /></p>
<p>When you&#8217;ve done that, go ahead and double click on the MyVideoPlayer movieclip. Create a new layer and draw a rectangle with the same size as your FLVPlayback component. Convert this in to a movieclip and specify it&#8217;s instance name to &#8220;boundingBox&#8221;. Once we use our component in Flex, it will not be visible. Flex will use this &#8220;boundingBox&#8221; movieclip to determine how big your component actually is.</p>
<p>By default, the FLVPlayback component will also show a player skin. If your FLVPlayback component isn&#8217;t previewing a player skin, you can select the skin you want to use in the parameters panel. In my case I&#8217;m going to select SkinOverAllNoFullNoCaption as my player skin.</p>
<p style="text-align: center;"><img src="http://www.webkitchen.be/wp-content/uploads/2008/05/5-parameter1.jpg" border="0" alt="5_parameter.jpg" width="509" height="131" /></p>
<p>Also, check if the autoPlay parameter and the skinAutoHide parameter are set to &#8220;true&#8221;<br />
Obviously you could also make your own player skin or even use the different button components. But in this case I want to keep it simple for demo purposes. Next we&#8217;re going to add some ActionScript to control the size and to set the source file. This may actually be a good time to save your FLA file. When you&#8217;ve done that, create a new ActionScript file (File &gt; New&#8230; &gt; ActionScript File). We&#8217;re actually going to create an ActionScript class for our MyVideoPlayer MovieClip. Sadly, Flash CS3 doesn&#8217;t give you the option to automatically make the class structure so you have to do that manually.<br />
Just copy paste this code snippet to start with:</p>
<pre lang="actionscript">package {
	import mx.flash.UIMovieClip;
	import flash.display.MovieClip;
	public dynamic class MyVideoPlayer extends UIMovieClip {
		public function MyVideoPlayer() {
			super();
		}
	}
}</pre>
<p>Go ahead and save that AS file in the same folder as your FLA and name it &#8220;MyVideoPlayer.as&#8221;. Now go back to your FLA and right-click on the MyVideoPlayer movieclip in the Library panel and select &#8220;Linkage&#8221;. We&#8217;re actually going to link the class file that we just created to this movieclip.</p>
<p style="text-align: center;"><img src="http://www.webkitchen.be/wp-content/uploads/2008/05/6-library.jpg" border="0" alt="6_library.jpg" width="185" height="300" /></p>
<p>When you tick the &#8220;Export for ActionScript&#8221; box, your window should automatically look like this:</p>
<p style="text-align: center;"><img src="http://www.webkitchen.be/wp-content/uploads/2008/05/7-linkage.jpg" border="0" alt="7_linkage.jpg" width="522" height="315" /></p>
<p>To verify that you saved and named everything correctly, click on the &#8220;Edit class definition&#8221; icon: <img src="http://www.webkitchen.be/wp-content/uploads/2008/05/8-edit.jpg" border="0" alt="8_edit.jpg" width="24" height="22" align="top" /><br />
This should bring you back to the ActionScript class. if it doesn&#8217;t, make sure the name is correct and that you saved the AS file in the same folder as your FLA file. Don&#8217;t forget to click &#8220;OK&#8221; to save your linkage settings.</p>
<p>Now have another look at the Class structure. As you can see, we&#8217;re going to extend the UIMovieClip class. This class has all the methods a normal Flex component has. That means I can automatically use getters and setters like any other Flex component has. So the first function I&#8217;m going to create is a setter function to specify the video source file url.</p>
<pre lang="actionscript">public function set source(MyVid:String):void{
	MyPlayer.play(MyVid);
}</pre>
<p>No rocket science here. I just tell the FLVPlayback component inside my movieclip to play the video file I will pass it.<br />
I also want to be able to size the component to whatever size I want. You could use the standard width and height setters but I&#8217;m not going to do that. I&#8217;m actually going to override these setters so I can set the width and height of the FLVPlayback component instead of the whole component. If I wouldn&#8217;t do that, my playerskin would become distorted and stretched. So go ahead and add these lines of code:</p>
<pre lang="actionscript">override public function set width(w:Number):void{
	MyPlayer.width = w;
}
override public function set height(h:Number):void{
	MyPlayer.height = h;
}</pre>
<p>Your class file should now look like this:</p>
<pre lang="actionscript">package {
	import mx.flash.UIMovieClip;
	import flash.display.MovieClip;
	public dynamic class MyVideoPlayer extends UIMovieClip {
		public function MyVideoPlayer() {
			super();
		}
		public function set source(MyVid:String):void{
			MyPlayer.play(MyVid);
		}
		override public function set width(w:Number):void{
			MyPlayer.width = w;
		}
		override public function set height(h:Number):void{
			MyPlayer.height = h;
		}
	}
}</pre>
<p>Now we are ready to &#8216;bake&#8217; our Flex component. Select the MyVideoPlayer movieclip in the library window and then select the &#8220;Convert Symbol to Flex Component&#8221; command in the Commands menu. Chances are Flash will give you a little popup window telling you that your framerate doesn&#8217;t match the default framerate that Flex uses.</p>
<p style="text-align: center;"><img src="http://www.webkitchen.be/wp-content/uploads/2008/05/9-framerate.jpg" border="0" alt="9_framerate.jpg" width="475" height="190" /></p>
<p>Just go ahead and click &#8220;OK&#8221;. In the Output window, Flash will ask you to publish your file:</p>
<pre>Select File &gt; Publish to create the SWC file for use in Flex.</pre>
<p>Obviously, this is what you want to do next.</p>
<p>When you did that, Flash created a couple of files for you:</p>
<p style="text-align: center;"><img src="http://www.webkitchen.be/wp-content/uploads/2008/05/10-directory.jpg" border="0" alt="10_directory.jpg" width="227" height="126" /></p>
<p>The SWC-file is the one we will be using in Flex. Open up Flex Builder 3 and create a new project. The first thing we need to do, is add our component to the Flex library so it knows that this is now available. In Flex Builder 3 it&#8217;s as easy as just copying the SWC file in to the libs folder of your project. You can even drag it in there straight from your Finder or Explorer window.</p>
<p>If you&#8217;ve done that, we also need to add the player skin we&#8217;re using. This goes in to the src folder. So go ahead and drag &#8220;SkinOverAllNoFullNoCaption.swf&#8221; to the src folder of your Flex project. Your project folder should now look like this:</p>
<p style="text-align: center;"><img src="http://www.webkitchen.be/wp-content/uploads/2008/05/11-flexfolder.jpg" border="0" alt="11_flexfolder.jpg" width="304" height="145" /></p>
<p>Now open your projects main MXML file. In my case it&#8217;s called &#8220;FlashFlexMarriage.mxml&#8221;. If your Flex Builder is in Design view, switch to Code view. When you start typing &#8220;&lt;MyVideoPlayer&#8221;, you will see that Flex Builder now knows your component and gives you codecompletion for it. When you hit Enter, the &#8220;local&#8221; namespace will be added to the application descriptor and your component will be added. Now you can add the source of your FLV.</p>
<pre lang="xml"></pre>
<p>Go ahead and run this project. Your video should start playing instantly.</p>
<p><img src="http://www.webkitchen.be/wp-content/uploads/2008/05/12-player.jpg" border="0" alt="12_player.jpg" width="319" height="213" /></p>
<p>I think it would be nicer to see this video a bit bigger and because we added the width and height setters, we can do that without distorting our playerskin.</p>
<pre lang="xml"></pre>
<p>When you run it again, you&#8217;ll see that the playerskin is still proportioned in the same way.</p>
<p>Tadaaa! You have now successfully created a Flex component in Flash. Obviously, this is just an example and you can do so much more but I think this shows how powerful the combination of Flash and Flex can be.</p>
<p>For your convenience, I&#8217;ve also included the the sources for this project. You can <a title="FlashFlexMarriageSources.zip" href="http://www.webkitchen.be/wp-content/uploads/2008/05/flashflexmarriagesources.zip">download them here</a>.</p>
<iframe id="basic_facebook_social_plugins_likebutton" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.webkitchen.be%2F2008%2F05%2F05%2Fthe-flash-and-flex-marriage%2F&amp;layout=standard&amp;show_faces=true&amp;width=500&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:500px; height:75px"></iframe>]]></content:encoded>
			<wfw:commentRss>http://www.webkitchen.be/2008/05/05/the-flash-and-flex-marriage/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>

