<?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>The Pixel Code &#187; Flex</title>
	<atom:link href="http://www.thepixelcode.com/category/development/flex/feed" rel="self" type="application/rss+xml" />
	<link>http://www.thepixelcode.com</link>
	<description>Design / Develop / Inspiration by Mohammed Khan</description>
	<lastBuildDate>Mon, 19 Jul 2010 03:45:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Video feed exchange using Adobe Stratus</title>
		<link>http://www.thepixelcode.com/development/flex/video-feed-exchange-using-adobe-stratus</link>
		<comments>http://www.thepixelcode.com/development/flex/video-feed-exchange-using-adobe-stratus#comments</comments>
		<pubDate>Sun, 05 Jul 2009 16:15:48 +0000</pubDate>
		<dc:creator>Mohammed Khan</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[RTMFP]]></category>
		<category><![CDATA[Adobe Stratus]]></category>

		<guid isPermaLink="false">http://www.thepixelcode.com/?p=176</guid>
		<description><![CDATA[In continuation of my excitement to work with Adobe Stratus and test the RTMFP protocol capabilities, here is another example on how two flash player 10 clients can exchange video feeds with each other without the need of routing through any media server like Flash Media Server. In my earlier post where the source code [...]]]></description>
			<content:encoded><![CDATA[<p>In continuation of my excitement to work with Adobe Stratus and test the RTMFP protocol capabilities, here is another example on how two flash player 10 clients can exchange video feeds with each other without the need of routing through any media server like Flash Media Server. In my earlier <a href="http://www.thepixelcode.com/development/flex/developing-a-chat-application-with-adobe-stratus">post</a> where the source code was in accordance to Ryan Stewart&#8217;s <a href="http://blog.digitalbackcountry.com/2009/06/building-a-p2p-chat-application-with-adobe-stratus/">demo</a>, to demonstrate text chat capabilities using Adobe Stratus service.</p>
<p>Just to extend and be original, I wanted to test the video feed exchange over Adobe Stratus, and to my surprise I found that the plumbing code required to bind the feeds to the NetStreams is very similar when working with text chat. In fact when you look at the code, you will find that only two new methods are written to publish and subscribe the video streams</p>
<pre class="java">
//Used to bind your local camera (webcam) to the VideoDisplay
private function nearId_videoDisplay_creationComplete():void
{
   var camera:Camera = Camera.getCamera();
   if (camera)
   {
      vdispNearId.attachCamera(camera);
   }
   else
   {
      Alert.show("You don't seem to have a camera.");
   }
}

//Used for streaming your local webcam video feed
public function onVideoSend():void
{
     var camera:Camera = Camera.getCamera();
     //var mic:Microphone = Microphone.getMicrophone();
     sendStream.attachCamera(camera);
     //sendStream.attachAudio(mic);
     btnNearIdVideoStream.enabled= false;

}

//Used for displaying remote camera(webcam) video feed
public function onVideoRecieve():void
{
     remoteVideo = new Video();
     remoteVideo.width = 320;
     remoteVideo.height = 240;
     remoteVideo.attachNetStream(recievedStream);
     vdispFarId.addChild(remoteVideo);

}</pre>
<p>The two NetStreams, <code>sendStream</code> and r<code>ecievedStream</code>, is what one would work it. You can practically attache (publish) audio, video and byteArray data to the <code>sendStream</code>, and the remote host can subscribe to your feed. One thing that really makes me interested with RTMFP is the ISP bandwidth cost. Earlier, when AV exchange sites (running on Media Servers like FMS), had to bare the cost of the video feed exchange over their bandwidth, but with RTMFP, they no longer have. With services like Adobe Stratus, which only maintain the session between the two Flash Player 10 clients, and the binary feeds exchanged between the Flash Player 10 clients is at the user&#8217;s cost. </p>
<div id="attachment_196" class="wp-caption alignnone" style="width: 310px"><a href="http://www.thepixelcode.com/wp-content/uploads/2009/07/Picture-1.png"><img src="http://www.thepixelcode.com/wp-content/uploads/2009/07/Picture-1-300x187.png" alt="Stratus Video Feed App" title="Stratus Video Feed App" width="300" height="187" class="size-medium wp-image-196" /></a><p class="wp-caption-text">Stratus Video Feed App</p></div>
<p>Below is the source code attached for you to try to and test. Also remember you would need Flash Player 10 installed and two different browser to test out. Also you would need your Adobe Stratus Developer Key which can be obtained <a href="http://labs.adobe.com/technologies/stratus/">here</a>.</p>
<p><a href='http://www.thepixelcode.com/wp-content/uploads/2009/07/SampleStratusVideoApp.zip'>Sample Stratus Video App Zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thepixelcode.com/development/flex/video-feed-exchange-using-adobe-stratus/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developing a Chat Application with Adobe Stratus</title>
		<link>http://www.thepixelcode.com/development/flex/developing-a-chat-application-with-adobe-stratus</link>
		<comments>http://www.thepixelcode.com/development/flex/developing-a-chat-application-with-adobe-stratus#comments</comments>
		<pubDate>Fri, 03 Jul 2009 23:06:01 +0000</pubDate>
		<dc:creator>Mohammed Khan</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Adobe Stratus]]></category>
		<category><![CDATA[RTMFP]]></category>

		<guid isPermaLink="false">http://www.thepixelcode.com/?p=147</guid>
		<description><![CDATA[In continuation to my previous blog,I was eager to test the Adobe Stratus service. Unlike Adobe Flash Collaboration Service (AFCS) aka Cocomo, Stratus is simple and straight forward to use. It doesn&#8217;t require you to download any library SWCs, just a simple Developer Key, and you are on your way to develop collaborative apps. The [...]]]></description>
			<content:encoded><![CDATA[<p>In continuation to my previous <a href="http://www.thepixelcode.com/development/flash/comparing-rtmp-and-rtmfp-protocols">blog</a>,I was eager to test the <a href="http://labs.adobe.com/technologies/stratus/">Adobe Stratus</a> service. Unlike Adobe Flash Collaboration Service (AFCS) aka Cocomo, Stratus is simple and straight forward to use. It doesn&#8217;t require you to download any library SWCs, just a simple Developer Key, and you are on your way to develop collaborative apps. The hight light of Stratus is that it lets the flash player 10 clients connect to each other over the RTMFP protocol. Using Stratus one could be able to develop AV and text based collaborative apps, in fact what I feel is Stratus is kind of service that lets you experiment around with RTMFP and the new feature within Flash Player 10 (to connect with other Flash Player 10). AFCS gives you more control over the wire, but Stratus is simple to just get started. Well to work Stratus or AFCS, some prior knowledge of working with Flash Media Server can be handy. </p>
<div id="attachment_169" class="wp-caption alignnone" style="width: 310px"><a href="http://www.thepixelcode.com/wp-content/uploads/2009/07/StratusChat.png"><img src="http://www.thepixelcode.com/wp-content/uploads/2009/07/StratusChat-300x187.png" alt="Adobe Stratus Demo Chat App" title="Adobe Stratus Demo Chat App" width="300" height="187" class="size-medium wp-image-169" /></a><p class="wp-caption-text">Adobe Stratus Demo Chat App</p></div>
<p>I have attached the source code of FB3.3 sdk based chat application which was used by Ryan Stewart to demonstrate <a href="http://blog.digitalbackcountry.com/2009/06/building-a-p2p-chat-application-with-adobe-stratus/">here</a>, for code review and how to make it work, use the video to understand.  Also note to run the application you will the need the developer key, which you can obtain <a href="http://labs.adobe.com/technologies/stratus/">here</a>. And two different browsers, so that two different Flash Player clients can connect to each other. </p>
<p><a href='http://www.thepixelcode.com/wp-content/uploads/2009/07/SampleStratusChatApp.zip'>SampleStratusChatApp</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thepixelcode.com/development/flex/developing-a-chat-application-with-adobe-stratus/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Embedding Fonts for Flex in SWC</title>
		<link>http://www.thepixelcode.com/development/flex/embedding-fonts-for-flex-in-swc</link>
		<comments>http://www.thepixelcode.com/development/flex/embedding-fonts-for-flex-in-swc#comments</comments>
		<pubDate>Thu, 02 Jul 2009 21:59:49 +0000</pubDate>
		<dc:creator>Mohammed Khan</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[SWC]]></category>

		<guid isPermaLink="false">http://www.thepixelcode.com/?p=105</guid>
		<description><![CDATA[Its common that when a Flex developer needs to embed certain assets like images, fonts or skin graphics, SWF is the first thing that one would assemble using Adobe Flash CS3, but I was just wondering instead of loading the assets library at runtime, why not compile it within the main flex project. As we [...]]]></description>
			<content:encoded><![CDATA[<p>Its common that when a Flex developer needs to embed certain assets like images, fonts or skin graphics, SWF is the first thing that one would assemble using Adobe Flash CS3, but I was just wondering instead of loading the assets library at runtime, why not compile it within the  main flex project. As we usually do with other library files which needs to be included, I would then need to build a SWC using the Adobe Flash CS3 which shall contain the assets.</p>
<p>To try out, lets look at embedding few fonts which I wish to use in Flex project for styling the label text. Open Flash CS3, and follow the steps to create an SWC in which fonts are embedded.</p>
<ol>
<li>Embed a font by going to the library, and in the top right corner drop down, select “New Font…”. In the dialogue box, select the font that you want to embed, and give it a library name.</li>
<li>Then, in the library, right click the font, and select “Linkage…”.</li>
<li>Select “Export for ActionScript”, and give the font a class name, I gave here as <code>com.thepixelcode.fonts.EmbedSensation.</code></li>
<li>While exporting make sure that the option Export SWC is selected, you can name at this point the SWC as FontsLibrary.swc.</li>
</ol>
<p>Fire up your Flex Builder 3 and follow this steps :</p>
<ol>
<li>Create a Flex project called SampleFontTest and click Next.</li>
<li>Let the output folder be bin-debug and click Next.</li>
<li>In the Main Application Field, I usually prefer to name it as index.mxml, this is because when hosting on servers, its easy to deploy through scripts (don&#8217;t need t change name or do a mapping).</li>
<li>Now in the Navigator you should find your flex project, and in the libs folder add the FontsLibrary.swc.</li>
<li>Look at the code below for  index.mxml where during the project initialization the fonts are registered and can be used as fontNames for labels or text.</li>
</ol>
<pre class="java">
import com.thepixelcode.fonts.*;

//Registering fonts embedded in FontsLibrary.swc during initialization

public function init():void {

Font.registerFont(com.thepixelcode.fonts.EmbedGoudyTwenty);
Font.registerFont(com.thepixelcode.fonts.EmbedKomika);
Font.registerFont(com.thepixelcode.fonts.EmbedMothproof);
Font.registerFont(com.thepixelcode.fonts.EmbedSensation);

}</pre>
<p>You can find the source code below to try and test, there are other ways to register the font, but would simply increase code or add would need to add CSS definitions for styles. </p>
<p><a href='http://www.thepixelcode.com/wp-content/uploads/2009/07/SampleTestFont.zip'>SampleTestFont Source Zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thepixelcode.com/development/flex/embedding-fonts-for-flex-in-swc/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
