<?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>YTechie.com &#187; flex</title>
	<atom:link href="http://www.ytechie.com/category/flex/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ytechie.com</link>
	<description>Productive software development using ASP.NET, C#, Adobe Flex, and other technologies and tools.</description>
	<lastBuildDate>Fri, 06 Nov 2009 21:16:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Google officially indexing flash sites &#8211; good news?</title>
		<link>http://www.ytechie.com/2008/07/google-officially-indexing-flash-sites-good-news.html</link>
		<comments>http://www.ytechie.com/2008/07/google-officially-indexing-flash-sites-good-news.html#comments</comments>
		<pubDate>Tue, 01 Jul 2008 14:47:40 +0000</pubDate>
		<dc:creator>superjason</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[seo]]></category>

		<guid isPermaLink="false">http://www.ytechie.com/2008/07/google-officially-indexing-flash-sites-good-news.html</guid>
		<description><![CDATA[According to the official Google blog, they&#8217;re now officially indexing flash content. According to my SEO expert, they&#8217;ve been doing this for some time. However, I wonder if making this official is a good news.
 
One of the big arguments against heavily using flash on your site was that it certainly wouldn&#8217;t help you in [...]]]></description>
			<content:encoded><![CDATA[<p>According to the official Google blog, they&#8217;re now <a href="http://googleblog.blogspot.com/2008/06/google-learns-to-crawl-flash.html" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/googleblog.blogspot.com/2008/06/google-learns-to-crawl-flash.html?referer=');">officially indexing flash content</a>. According to my SEO expert, they&#8217;ve been doing this for some time. However, I wonder if making this official is a good news.</p>
<p align="center"><img height="151" alt="image" src="http://www.ytechie.com/post-images/2008/07/image.png" width="151" border="0" /> </p>
<p>One of the big arguments against heavily using flash on your site was that it certainly wouldn&#8217;t help you in Google. Now, many will see that argument as being gone. We can now look forward to more annoying flash content, and <em>maybe</em> even some flash that is used correctly.</p>
<blockquote><p>With great power comes great responsibility</p>
<p>-Stan Lee</p>
</blockquote>
<p>If you think you can now cheat and use flash content instead of HTML, you&#8217;re probably wrong. There are many questions that have now been raised (<a href="http://googlewebmastercentral.blogspot.com/2008/06/improved-flash-indexing.html" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/googlewebmastercentral.blogspot.com/2008/06/improved-flash-indexing.html?referer=');">some have been answered</a>):</p>
<ul>
<li>Does each flash file count as a page?</li>
<li>Do links to and from flash content count for PageRank?</li>
<li>Do you really want ALL of the text in your flash files indexed?</li>
<li>Does the SWF get executed in any way, so that the <em>generated</em> text can be indexed?</li>
</ul>
<p>It&#8217;s going to take a while before Google gets good at indexing flash files. It&#8217;s also going to take some time for people to really understand how the process is working. I wouldn&#8217;t be too quick to convert something to flash just because Google can see it now.</p>
<p>Only use flash when it makes sense to your users. For example, <a href="http://www.choiceshirts.com/" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/www.choiceshirts.com/?referer=');">Choice Shirts</a> has an HTML website, but their <a href="http://www.choiceshirts.com/design_your_own/" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/www.choiceshirts.com/design_your_own/?referer=');">shirt designer</a> is flash (<a href="http://www.adobe.com/products/flex/" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/www.adobe.com/products/flex/?referer=');">Flex</a> actually). If their designer doesn&#8217;t get indexed, it&#8217;s not a big deal. The designer is there for usability, not for the search engines.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ytechie.com/2008/07/google-officially-indexing-flash-sites-good-news.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Take a screenshot in Flex and send it to ASP.NET</title>
		<link>http://www.ytechie.com/2008/04/take-a-screenshot-in-flex-and-send-it-to-aspnet.html</link>
		<comments>http://www.ytechie.com/2008/04/take-a-screenshot-in-flex-and-send-it-to-aspnet.html#comments</comments>
		<pubDate>Tue, 22 Apr 2008 17:52:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://207.36.235.13/2008/04/take-a-screenshot-in-flex-and-send-it-to-aspnet.html</guid>
		<description><![CDATA[In Adobe Flex 3, you can get a bitmap image of any control by using this code (you&#8217;ll need to import &#34;mx.graphics.ImageSnapshot&#34;):
var snapshot:ImageSnapshot =  ImageSnapshot.captureImage(backgroundCanvas);
By default, it uses PNG encoding.
If you want to then send this image to the server, use this code:
var req:URLRequest = new URLRequest();
req.method = URLRequestMethod.POST;
req.data = snapshot.data;
req.contentType=&#34;application/octet-stream&#34;;
req.url = &#34;snapshotuploadhandler.aspx&#34;;
var loader:URLLoader [...]]]></description>
			<content:encoded><![CDATA[<p>In Adobe Flex 3, you can get a bitmap image of any control by using this code (you&#8217;ll need to import &quot;mx.graphics.ImageSnapshot&quot;):</p>
<pre class="javascript" name="code">var snapshot:ImageSnapshot =  ImageSnapshot.captureImage(backgroundCanvas);</pre>
<p>By default, it uses PNG encoding.</p>
<p>If you want to then send this image to the server, use this code:</p>
<pre class="javascript" name="code">var req:URLRequest = new URLRequest();
req.method = URLRequestMethod.POST;
req.data = snapshot.data;
req.contentType=&quot;application/octet-stream&quot;;
req.url = &quot;snapshotuploadhandler.aspx&quot;;
var loader:URLLoader = new URLLoader;
loader.load(req);</pre>
<p>Reading the uploaded file is easy using ASP.NET:</p>
<pre class="c-sharp" name="code">private byte[] readPostedFile()
{
   if (Request.ContentLength &gt; 0)
   {
       byte[] buffer = new byte[Request.ContentLength];
       using (BinaryReader br = new BinaryReader(Request.InputStream))
           br.Read(buffer, 0, buffer.Length);
       return buffer;
   }
   else
   {
       return null;
   }
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ytechie.com/2008/04/take-a-screenshot-in-flex-and-send-it-to-aspnet.html/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Reading an octet stream post in ASP.NET</title>
		<link>http://www.ytechie.com/2008/04/reading-an-octet-stream-post-in-aspnet.html</link>
		<comments>http://www.ytechie.com/2008/04/reading-an-octet-stream-post-in-aspnet.html#comments</comments>
		<pubDate>Tue, 15 Apr 2008 20:02:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://207.36.235.13/2008/04/reading-an-octet-stream-post-in-aspnet.html</guid>
		<description><![CDATA[I&#8217;m using Adobe Flex to take a snapshot of some controls. I turn the PNG encoded bitmap data into a ByteArray. I then send the data to the server, through an ASP.NET page. On the Flex side of things, I send the data over with the following code:
var req:URLRequest = new URLRequest();
req.method = URLRequestMethod.POST;
req.data = [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using <a href="http://www.adobe.com/products/flex/" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/www.adobe.com/products/flex/?referer=');">Adobe Flex</a> to take a <a href="http://dougmccune.com/blog/2007/06/11/imagesnapshot-class-in-flex-3-sdk/" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/dougmccune.com/blog/2007/06/11/imagesnapshot-class-in-flex-3-sdk/?referer=');">snapshot of some controls</a>. I turn the PNG encoded bitmap data into a ByteArray. I then send the data to the server, through an ASP.NET page. On the Flex side of things, I send the data over with the following code:</p>
<pre class="javascript" name="code">var req:URLRequest = new URLRequest();
req.method = URLRequestMethod.POST;
req.data = snapshot.data;
req.contentType=&quot;application/octet-stream&quot;;
req.url = &quot;snapshotuploadhandler.aspx&quot;;

var loader:URLLoader = new URLLoader;
loader.load(req);</pre>
<p>I assumed this code was incorrect, but it was actually the code in the receiving page. Instead of checking the &quot;Files&quot; property on the request object, I needed to read the InputStream on the request. Here is the working code: </p>
<pre class="c-sharp" name="code">if (Request.ContentLength &gt; 0)
{
    byte[] buffer = new byte[Request.ContentLength];
    using (BinaryReader br = new BinaryReader(Request.InputStream))
        br.Read(buffer, 0, buffer.Length);
    return buffer;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ytechie.com/2008/04/reading-an-octet-stream-post-in-aspnet.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Uninitialized variables in Adobe Flex &quot;for&quot; loops</title>
		<link>http://www.ytechie.com/2008/03/uninitialized-variables-in-adobe-flex-for-loops.html</link>
		<comments>http://www.ytechie.com/2008/03/uninitialized-variables-in-adobe-flex-for-loops.html#comments</comments>
		<pubDate>Mon, 31 Mar 2008 21:10:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://207.36.235.13/2008/03/uninitialized-variables-in-adobe-flex-for-loops.html</guid>
		<description><![CDATA[for(var j:int; j &#60; editAreas.length; j++)
    trace(&#34;doing something&#34;);
What&#8217;s wrong with this ActionScript code? This was a block of code that I fixed while tracking down a nasty bug. c# would have never let me do this.

Basically, the &#34;j&#34; variable starts out at 0 in the method. That&#8217;s fine, because it&#8217;s what I [...]]]></description>
			<content:encoded><![CDATA[<pre class="javascript" name="code">for(var j:int; j &lt; editAreas.length; j++)
    trace(&quot;doing something&quot;);</pre>
<p>What&#8217;s wrong with this ActionScript code? This was a block of code that I fixed while tracking down a nasty bug. c# would have never let me do this.</p>
<p><img height="110" alt="image" src="/post-images/2008/03/no-bugs.png" width="110" border="0" /></p>
<p>Basically, the &quot;j&quot; variable starts out at 0 in the method. That&#8217;s fine, because it&#8217;s what I would normally expect. The problem is that I have it declared inside another loop, so this loop initializer is run multiple times. The second time around, &quot;j&quot; maintains it&#8217;s value. It could start at 5 next time. The loop still partially works, if the length of the arrays get longer each time. It&#8217;s a bit odd that the &quot;j&quot; variable is never created more than once. I&#8217;m guessing it&#8217;s a compiler optimization.</p>
<p>This loop was used in a drawing routine for images. If you had an image in the first drawing area, the first image in the consecutive drawing areas would never be drawn.</p>
<p>It should be obvious, but please don&#8217;t forget to initialize your &quot;for&quot; loop variables.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ytechie.com/2008/03/uninitialized-variables-in-adobe-flex-for-loops.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
