<?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>Jozef Chúťka&#039;s blog</title>
	<atom:link href="http://blog.yoz.sk/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.yoz.sk</link>
	<description>My life, my work</description>
	<lastBuildDate>Fri, 27 Aug 2010 12:43:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Publish Your AIR Applications To Facebook</title>
		<link>http://blog.yoz.sk/2010/08/publish-your-air-applications-to-facebook/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=publish-your-air-applications-to-facebook</link>
		<comments>http://blog.yoz.sk/2010/08/publish-your-air-applications-to-facebook/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 11:19:26 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[badge]]></category>
		<category><![CDATA[publish]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=2263</guid>
		<description><![CDATA[Hi folks! Today, while mounting some of my projects into AIR, I realized that it would be great if I could pusblish AIR badges over Facebook. You know what? That is possible! I have created a simple flex application + facebook application that, based on parameters, generates AIR badge for an app. Now its time [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.yoz.sk/wp-content/uploads/airfacebook.jpg" alt="" title="airfacebook" width="200" height="100" class="alignleft size-full wp-image-2281" /></p>
<p>Hi folks! Today, while mounting some of my <a href="http://blog.yoz.sk/category/projects/">projects</a> into <a href="http://www.adobe.com/uk/products/air/">AIR</a>, I realized that it would be great if I could pusblish <a href="http://www.adobe.com/devnet/air/articles/badge_for_air.html">AIR badges</a> over Facebook. You know what? That is possible! I have created a simple flex application + facebook application that, based on parameters, generates AIR badge for an app. Now its time to share the stuff with you, feel free to publish your AIR badges, and let me know how do you like it.</p>
<p><span id="more-2263"></span></p>
<p>How to use it?</p>
<ol>
<li>Use application inserted below, or open (and bookmark) it in <a href="http://blog.yoz.sk/examples/FacebookAirPublisher/" target="_blank">new window</a>, or use <a href="http://apps.facebook.com/airpublisher/">AIR publisher facebook application</a></li>
<li>click connect (if using facebook application it connects you automatically)</li>
<li>fill desired parameters (click &#8220;fill example&#8221; button to demonstrate working parameters for one of my applications)</li>
<li>click &#8220;publish&#8221; button</li>
<li>wait for Alert with publishing status (displays post id if succeeded)</li>
</ol>
<p>By default it publishes AIR badge directly into <strong>your facebook stream</strong> (wall), plus if you click &#8220;Like&#8221; on my facebook application (facebook restriction), it also publishes the badge into <strong><a href="http://www.facebook.com/apps/application.php?id=102992186427977&#038;v=wall">AIR publisher application wall</a></strong>.</p>
<p><iframe src="http://www.facebook.com/plugins/likebox.php?id=102992186427977&amp;width=292&amp;connections=0&amp;stream=false&amp;header=false&amp;height=62" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100%; height:62px;background:#ffffff"></iframe></p>
<p><iframe src="http://blog.yoz.sk/examples/FacebookAirPublisher" width="100%" height="600" frameborder="0" style="border:none;"></iframe></p>
<p>How would your facebook post look like?</p>
<p><img src="http://blog.yoz.sk/wp-content/uploads/facebookbadge.jpg" alt="" title="facebookbadge" width="511" height="466" class="alignleft size-full wp-image-2278" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2010/08/publish-your-air-applications-to-facebook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Tip: Labeling Loops</title>
		<link>http://blog.yoz.sk/2010/08/quick-tip-labeling-loops/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=quick-tip-labeling-loops</link>
		<comments>http://blog.yoz.sk/2010/08/quick-tip-labeling-loops/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 13:13:02 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[break]]></category>
		<category><![CDATA[for]]></category>
		<category><![CDATA[for each]]></category>
		<category><![CDATA[label]]></category>
		<category><![CDATA[loops]]></category>
		<category><![CDATA[while]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=2256</guid>
		<description><![CDATA[Did you know you can label loops in ActionScript 3? Yes, you can! I got inspired by latest tweets referencing source code in image. Lets do some small experiments&#8230; Label all of them: var a:uint, b:uint = 0; loopA:for(a = 0; a &#60; 10; a++) loopB:while(b++ &#60; 100) loopC:for each(var c:uint in [0,1,2,3]) break loopB; [...]]]></description>
			<content:encoded><![CDATA[<p>Did you know you can label loops in ActionScript 3? Yes, you can! I got inspired by latest tweets referencing <a href="http://shots.nocreativity.com/af10ceecfe3e71074041d5d8da893abf.jpg">source code in image</a>. Lets do some small experiments&#8230; Label all of them:</p>
<pre class="brush: as3;">var a:uint, b:uint = 0;
loopA:for(a = 0; a &lt; 10; a++)
    loopB:while(b++ &lt; 100)
        loopC:for each(var c:uint in [0,1,2,3])
            break loopB;

trace(a, b, c); // traces &quot;10 10 0&quot;</pre>
<p><span id="more-2256"></span></p>
<p>Where to go from here</p>
<ul>
<li><a href="http://shots.nocreativity.com/af10ceecfe3e71074041d5d8da893abf.jpg">Nocreativity.com</a></li>
<li><a href="http://wonderfl.net/c/b2FY">See it in action on wonderfl.net</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2010/08/quick-tip-labeling-loops/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quick Tip: Checking The Version Of An Installed AIR Application</title>
		<link>http://blog.yoz.sk/2010/08/quick-tip-checking-the-version-of-an-installed-air-application/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=quick-tip-checking-the-version-of-an-installed-air-application</link>
		<comments>http://blog.yoz.sk/2010/08/quick-tip-checking-the-version-of-an-installed-air-application/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 15:11:10 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[air.swf]]></category>
		<category><![CDATA[allowBrowserInvocation]]></category>
		<category><![CDATA[getApplicationVersion]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=2209</guid>
		<description><![CDATA[Here is a quick tip how to check the version of your installed AIR application from an application running in flash player. In order to make your AIR application (system) be able to respond to the requests for installed version correctly you need to define allowBrowserInvocation within your AIR descriptor file (app.xml). If you don’t [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a quick tip how to check the version of your installed AIR application from an application running in flash player. In order to make your AIR application (system) be able to respond to the requests for installed version correctly you need to define <strong>allowBrowserInvocation</strong> within your AIR descriptor file (app.xml). If you don’t do this, you won’t be able to query version information on your application:</p>
<pre class="brush: xml;">&lt;allowBrowserInvocation&gt;true&lt;/allowBrowserInvocation&gt;</pre>
<p>Now your AIR application will respond correctly with its installed version. With this setting on, the installed<a href="http://livedocs.adobe.com/flex/3/html/help.html?content=distributing_apps_3.html"> AIR application can be launched via the browser invocation</a> feature (by the user clicking a link in a page in a web browser). Be sure to consider <a href="http://livedocs.adobe.com/flex/3/html/app_launch_1.html#1038008">security implications</a>.</p>
<p>Now, to get version info from any application running in flash player (or AIR) you simply call <strong>getApplicationVersion()</strong> method on <a href="http://airdownload.adobe.com/air/browserapi/air.swf">air.swf</a> file located on adobe domain.</p>
<p><span id="more-2209"></span></p>
<pre class="brush: as3;">var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
loader.load(new URLRequest(&quot;http://airdownload.adobe.com/air/browserapi/air.swf&quot;));

function onComplete(event:Event):void
{
    // applicationID - &lt;id&gt;sk.yoz.whatever&lt;/id&gt; defined in app.xml
    // publisherID - WindowedApplication().nativeApplication.publisherID
    Object(loader.content).getApplicationVersion(applicationID, publisherID, appVersionCallback);
}

function appVersionCallback(version:String):void
{
    if (version == null)
        // application is not installed
    else
        // installed, compare variable version with some desired
}</pre>
<p>Please consider this code as extract from <a href="http://www.adobe.com/devnet/air/articles/badge_for_air.html">AIRInstallBadge package downloaded from Adobe</a>. The badge also uses more advanced features, make sure to read the article or see the source code.</p>
<p>Where to go from here:</p>
<ul>
<li><a href="http://www.adobe.com/devnet/air/articles/badge_for_air.html">Getting started with the custom install badge</a></li>
<li><a href="http://www.rogue-development.com/blog2/2008/03/interacting-with-an-air-app-from-a-browser-based-app/">Interacting with an AIR app from a browser based app</a></li>
<li><a href="http://knomedia.com/blog/2008/08/29/using-the-adobe-air-badge-install/">Using the Adobe AIR Install Badge</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2010/08/quick-tip-checking-the-version-of-an-installed-air-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Tip: How To Print From Google Wave</title>
		<link>http://blog.yoz.sk/2010/08/quick-tip-how-to-print-from-google/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=quick-tip-how-to-print-from-google</link>
		<comments>http://blog.yoz.sk/2010/08/quick-tip-how-to-print-from-google/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 10:05:10 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[Technologies]]></category>
		<category><![CDATA[googlewave]]></category>
		<category><![CDATA[print]]></category>
		<category><![CDATA[wave]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=2228</guid>
		<description><![CDATA[Google Wave is an online software application formerly developed by Google. Soon after you get used to this new collaboration tool, you may leave behind old spammy e-mails used for communication. While creating waves is easy and intuitive, there is no button to print the wave . Though, there is a chance. Print tip originally [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.yoz.sk/wp-content/uploads/googlewave.png" alt="" title="googlewave" width="200" height="100" class="alignleft size-full wp-image-2233" /></p>
<p>Google Wave is an online software application formerly developed by Google. Soon after you get used to this new collaboration tool, you may leave behind old spammy e-mails used for communication. While creating waves is easy and intuitive, there is no button to print the wave <img src='http://blog.yoz.sk/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> . Though, there is a chance. <a href="http://www.googlewaveinfo.com/200910/how-to-print-from-google-wave/">Print tip originally posted</a> in comments on <a href="http://www.googlewaveinfo.com/">googlewaveinfo.com</a>. In order to make this work, you have to run chrome with custom user-agent (iPhone 3).</p>
<p><span id="more-2228"></span></p>
<ol>
<li>run
<pre class="brush: plain;">chrome.exe -user-agent=&quot;Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16&quot;</pre>
</li>
<li>fire up <a href="https://wave.google.com/wave/">google wave</a></li>
<li>click ‘Go ahead’</li>
<li>select wave</li>
<li>print using browser’s print page functionality </li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2010/08/quick-tip-how-to-print-from-google/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Ultimate Guide To LocalConnection &#8211; SWF to SWF to AIR to AIR to SWF</title>
		<link>http://blog.yoz.sk/2010/08/the-ultimate-guide-to-localconnection-swf-to-air/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=the-ultimate-guide-to-localconnection-swf-to-air</link>
		<comments>http://blog.yoz.sk/2010/08/the-ultimate-guide-to-localconnection-swf-to-air/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 13:43:13 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[domain]]></category>
		<category><![CDATA[LocalConnection]]></category>
		<category><![CDATA[underscore]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=2181</guid>
		<description><![CDATA[Even if it stands in documentstion (some crucial things mentioned in one line somewhere), it was really tricky thing to figure out how to make LocalConnection-s work between different application runtimes (flash player / air). It got even more tangled with empty flash player error saying &#8220;Error #2044: Unhandled StatusEvent:. level=error, code=&#8221;. Basically, there is [...]]]></description>
			<content:encoded><![CDATA[<p>Even if it stands in <a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/net/LocalConnection.html">documentstion</a> (some crucial things mentioned in one line somewhere), it was really tricky thing to figure out how to make LocalConnection-s work between different application runtimes (flash player / air). It got even more tangled with empty flash player error saying &#8220;Error #2044: Unhandled StatusEvent:. level=error, code=&#8221;. Basically, there is a generic method/form, with underscore prefix for connection name, that you can successfully use in all cases, but if your application requires higher security you should define your connections more exactly.</p>
<p>Based on your applications origin (AIR / flash player) you may define a few types of communication nature:</p>
<ul>
<li>SWF to SWF on a same domain</li>
<li>SWF to SWF on different domains</li>
<li>AIR to SWF</li>
<li>SWF to AIR</li>
<li>AIR to AIR</li>
</ul>
<p><span id="more-2181"></span></p>
<p>Let&#8217;s suppose, we use the following variables and client definition for receiver:</p>
<pre class="brush: as3;">var localConnection:LocalConnection = new LocalConnection(); // both sender and receiver
localConnection.client = someInstanceWithPublicMethods // receiver only </pre>
<h3>SWF to SWF on a same domain</h3>
<p>This one is pretty common and simple situation:</p>
<pre class="brush: as3;">// receiver
localConnection.connect(&quot;connectionName&quot;);

// sender
localConnection.send(&quot;connectionName&quot;, &quot;methodName&quot;);</pre>
<h3>SWF to SWF on different domains</h3>
<p>Based on apps nature &#8211; for generic/unknown domains you can use super generic form (works for every combination domain/swf/air). Notice the underscore character &#8220;_&#8221; with connection name:</p>
<pre class="brush: as3;">// SWF receiver on unknown domain
localConnection.allowDomain(&quot;*&quot;);
localConnection.connect(&quot;_connectionName&quot;);

// SWF sender on unknown domain
sendingLC.send(&quot;_connectionName&quot;, &quot;methodName&quot;);</pre>
<p>&#8230; or more secure version, where you define exactly the domain you are targeting:</p>
<pre class="brush: as3;"> // SWF receiver on domain1.com
localConnection.allowDomain(&quot;domain2.com&quot;);
localConnection.connect(&quot;connectionName&quot;);

// SWF sender on domain2.com
localConnection.send(&quot;domain1.com:connectionName&quot;, &quot;methodName&quot;);</pre>
<h3>AIR to SWF</h3>
<p>Now its getting tricky, please focus. Air app calls method on swf on some exact domain:</p>
<pre class="brush: as3;">// SWF receiver on domain1.com
localConnection.allowDomain(&quot;app#SENDER*AIR*ID&quot;); // e.g. &quot;app#sk.yoz.air.SenderApp&quot;
localConnection.connect(&quot;connectionName&quot;);

// AIR sender
localConnection.send(&quot;domain1.com:connectionName&quot;, &quot;methodName&quot;);</pre>
<p>&#8230; or the same super generic method mentioned earlier for unknown/generic receiver swf file location</p>
<pre class="brush: as3;">// SWF receiver on unknown domain
localConnection.allowDomain(&quot;*&quot;);
localConnection.connect(&quot;_connectionName&quot;);

// AIR sender
localConnection.send(&quot;_connectionName&quot;, &quot;methodName&quot;);</pre>
<h3>SWF to AIR</h3>
<p>&#8230; now the opposite standing air receiver and swf sender:</p>
<pre class="brush: as3;">// AIR receiver
localConnection.allowDomain(&quot;domain1.com&quot;);
localConnection.connect(&quot;connectionName&quot;);

// SWF sender on domain1.com
localConnection.send(&quot;app#RECEIVER*AIR*ID:connectionName&quot;, &quot;methodName&quot;);
// e.g. &quot;app#sk.yoz.air.ReceiverApp:connectionName&quot;</pre>
<p>&#8230; or use super generic form:</p>
<pre class="brush: as3;">// AIR receiver
localConnection.allowDomain(&quot;domain1.com&quot;);
localConnection.connect(&quot;_connectionName&quot;);

// SWF sender on domain1.com
localConnection.send(&quot;_connectionName&quot;, &quot;methodName&quot;);</pre>
<h3>AIR to AIR</h3>
<p>This one is hefty, make sure to substitute with correct ids:</p>
<pre class="brush: as3;">// AIR receiver (sk.yoz.air.ReceiverApp)
localConnection.allowDomain(&quot;app#SENDER*AIR*ID&quot;); // e.g. &quot;app#sk.yoz.air.SenderApp&quot;
localConnection.allowDomain(&quot;localhost&quot;); // may help with local testing
localConnection.connect(&quot;connectionName&quot;);

// AIR sender (sk.yoz.air.SenderApp)
localConnection.send(&quot;app#RECEIVER*AIR*ID:connectionName&quot;, &quot;methodName&quot;);
// e.g. &quot;app#sk.yoz.air.ReceiverApp:connectionName&quot;</pre>
<p>&#8230; or once again the generic form, now possible even without allowDomain()</p>
<pre class="brush: as3;">// AIR receiver
localConnection.connect(&quot;_connectionName&quot;);

// AIR sender
localConnection.send(&quot;_connectionName&quot;, &quot;methodName&quot;);</pre>
<p>Where to go from here:</p>
<ul>
<li><a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/net/LocalConnection.html">LocalConnection Reference for AS3 / FP10.0</a></li>
<li><a href="http://forums.adobe.com/message/2833131">Adobe Forums: Local Connection Air to Air</a></li>
<li><a href="http://forums.adobe.com/thread/25745">Adobe Forums: Local Connection From Air to Air</a></li>
<li><a href="http://miti.pricope.com/2009/07/24/the-infamous-error-2044-unhandled-statusevent-levelerror-code-on-localconnection/">The infamous Error #2044: Unhandled StatusEvent:. level=error, code= on LocalConnection</a></li>
<li><a href="http://spy6.blogspot.com/2008/10/error-2044-unhandled-statusevent.html">Error #2044: Unhandled statusEvent</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2010/08/the-ultimate-guide-to-localconnection-swf-to-air/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Tip: Standalone Player Default Menu Disappeared</title>
		<link>http://blog.yoz.sk/2010/08/quick-tip-standalone-player-default-menu-disappeared/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=quick-tip-standalone-player-default-menu-disappeared</link>
		<comments>http://blog.yoz.sk/2010/08/quick-tip-standalone-player-default-menu-disappeared/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 09:39:35 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[ContextMenu]]></category>
		<category><![CDATA[exe]]></category>
		<category><![CDATA[projector]]></category>
		<category><![CDATA[showDefaultContextMenu]]></category>
		<category><![CDATA[Stage]]></category>
		<category><![CDATA[standalone]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=2183</guid>
		<description><![CDATA[Did you know that setting stage.showDefaultContextMenu = false, makes disappear not only right-click context-menu (ContextMenu), but also standalone player default window menu (File, View, Options, Help)? I came on this one when tried to create projectors (.exe) files from .swf-s files running in standalone player using &#8220;File / Create projector&#8230;&#8221; feature. All tested/opened .swf files [...]]]></description>
			<content:encoded><![CDATA[<p>Did you know that setting stage.showDefaultContextMenu = false, makes disappear not only right-click context-menu (<a href="http://livedocs.adobe.com/flex/3/langref/flash/ui/ContextMenu.html">ContextMenu</a>), but also standalone player default window menu (File, View, Options, Help)? I came on this one when tried to create projectors (.exe) files from .swf-s files running in standalone player using &#8220;File / Create projector&#8230;&#8221; feature. All tested/opened .swf files were showing player window menu ok, just one .swf made player window menu disappear, after a while I discovered the <a href="http://livedocs.adobe.com/flex/3/langref/flash/display/Stage.html#showDefaultContextMenu">showDefaultContextMenu</a> was the cause.</p>
<pre class="brush: as3;">stage.showDefaultContextMenu = false</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2010/08/quick-tip-standalone-player-default-menu-disappeared/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ActionScript Bitwise Calculator</title>
		<link>http://blog.yoz.sk/2010/08/actionscript-bitwise-calculator/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=actionscript-bitwise-calculator</link>
		<comments>http://blog.yoz.sk/2010/08/actionscript-bitwise-calculator/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 10:23:58 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[AND]]></category>
		<category><![CDATA[left]]></category>
		<category><![CDATA[NOT]]></category>
		<category><![CDATA[OR]]></category>
		<category><![CDATA[right]]></category>
		<category><![CDATA[shift]]></category>
		<category><![CDATA[XOR]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=2149</guid>
		<description><![CDATA[In computer programming, a bitwise operation operates on one or more bit patterns or binary numerals at the level of their individual bits. Bitwise operations are extremely fast and compact. Anytime we can speak to a computer in its native binary tongue, we save room and gain speed (moock.org). Now, lets see how it works. [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.yoz.sk/wp-content/uploads/bitwise.png" alt="" title="bitwise" width="200" height="100" class="alignleft size-full wp-image-2178" /></p>
<p>In computer programming, a bitwise operation operates on one or more bit patterns or binary numerals at the level of their individual bits.  Bitwise operations are extremely fast and compact. Anytime we can speak to a computer in its native binary tongue, we save room and gain speed (<a href="http://www.moock.org/asdg/technotes/bitwise/">moock.org</a>). Now, lets see how it works. I have created a small flex application, try playing with numbers (input decimals) to understand what is actually happening with bits using different operators (10 and 3 are good inputs).</p>
<p><span id="more-2149"></span></p>
<p><iframe src="http://blog.yoz.sk/examples/bitwiseCalc/" width="400" height="500"></iframe></p>
<p>View Source for application is enabled</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Bitwise_operation">Bitwise operation</a></li>
<li><a href="http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/operators.html">ActionScript 3.0 Language and Components Reference &#8211; Operators</a></li>
<li><a href="http://www.moock.org/asdg/technotes/bitwise/">Using bitwise operators in actionscript</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2010/08/actionscript-bitwise-calculator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Tip: Multi-Dimensional Vectors</title>
		<link>http://blog.yoz.sk/2010/08/quick-tip-multi-dimensional-vectors/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=quick-tip-multi-dimensional-vectors</link>
		<comments>http://blog.yoz.sk/2010/08/quick-tip-multi-dimensional-vectors/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 13:15:54 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[multi-dimensional]]></category>
		<category><![CDATA[Vector]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=2141</guid>
		<description><![CDATA[Have you ever thought of creating or using multi-dimensional Vector in ActionScript? Yes, it is possible and the definition syntax comes pretty logical to me now . var list:Vector.&#60;Vector.&#60;int&#62;&#62; = new Vector.&#60;Vector.&#60;int&#62;&#62;(); &#8230;or shorter declaration: var list:Vector.&#60;Vector.&#60;int&#62;&#62; = new &#60;Vector.&#60;int&#62;&#62;[]; now your vectors have two dimensions, I mean: list[0][0]]]></description>
			<content:encoded><![CDATA[<p>Have you ever thought of creating or using multi-dimensional Vector in ActionScript? Yes, it is possible and the definition syntax comes pretty logical to me now <img src='http://blog.yoz.sk/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> . </p>
<pre class="brush: as3;">var list:Vector.&lt;Vector.&lt;int&gt;&gt; = new Vector.&lt;Vector.&lt;int&gt;&gt;();</pre>
<p>&#8230;or shorter declaration:</p>
<pre class="brush: as3;">var list:Vector.&lt;Vector.&lt;int&gt;&gt; = new &lt;Vector.&lt;int&gt;&gt;[];</pre>
<p>now your vectors have two dimensions, I mean:</p>
<pre class="brush: as3;">list[0][0]</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2010/08/quick-tip-multi-dimensional-vectors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pixel Bender Inputs &#8211; Vector or ByteArray</title>
		<link>http://blog.yoz.sk/2010/08/pixel-bender-inputs-vector-or-bytearray/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=pixel-bender-inputs-vector-or-bytearray</link>
		<comments>http://blog.yoz.sk/2010/08/pixel-bender-inputs-vector-or-bytearray/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 13:07:13 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[ByteArray]]></category>
		<category><![CDATA[Endian]]></category>
		<category><![CDATA[pixel bender]]></category>
		<category><![CDATA[Shader]]></category>
		<category><![CDATA[ShaderJob]]></category>
		<category><![CDATA[Vector]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=2105</guid>
		<description><![CDATA[Pixel Bender for Flash Player lets you play some more advanced games. Based on your needs you can force your kernels to &#8220;eat&#8221; not only BitmapData, but also ByteArray-s or Vector-s. With this knowledge, you can simply use Pixel Bender kernels for some fast math or processing like 3D engines (3D to 2D projection) etc. [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.yoz.sk/wp-content/uploads/pixelbender.png" alt="" title="pixelbender" width="200" height="100" class="alignleft size-full wp-image-2130" /></p>
<p><a href="http://www.adobe.com/devnet/pixelbender/">Pixel Bender</a> for Flash Player lets you play some more advanced games. Based on your needs you can force your kernels to &#8220;eat&#8221; not only BitmapData, but also ByteArray-s or Vector-s. With this knowledge, you can simply use Pixel Bender kernels for some fast math or processing like 3D engines (3D to 2D projection) etc. Lets have a look at some simple demos, how to push vector and raw bytes directly into shader via ShaderJob:</p>
<p><span id="more-2105"></span></p>
<h3>Vector.&lt;Number&gt;</h3>
<p>Simple (one-dimension) vector may be recognized by pixel bender as 3-channel input just as simple as providing correct width/height for shader:</p>
<pre class="brush: as3;">var src:Vector.&lt;Number&gt; = new Vector.&lt;Number&gt;();
while(someLooping)
{
    src.push(x);
    src.push(y);
    src.push(z);
}

var shader:Shader = new Shader(code);
shader.data.src.input = src;
shader.data.src.width = src.length / 3; // forces pixel bender to use image3 as input
shader.data.src.height = 1;

var res:Vector.&lt;Number&gt; = new Vector.&lt;Number&gt;();
var job:ShaderJob = new ShaderJob(shader, res, src.length / 3, 1);
job.start(true);

for(var i:uint=0; i&lt;src.length; i+=3)
{
    x = res[i];
    y = res[i+1];
    z = res[i+2];
}</pre>
<h3>ByteArray</h3>
<p>If you are more in &#8220;low-level&#8221; things, try using raw bytes as input. Do not forget to setup LITTLE_ENDIAN for source and result variables. Also make sure width*height*4 results in source bytes length.</p>
<pre class="brush: as3;">var src:ByteArray = new ByteArray();
src.endian = Endian.LITTLE_ENDIAN;
src.position = 0;
while(someLooping)
{
    src.writeFloat(x);
    src.writeFloat(y);
    src.writeFloat(z);
}

var shader:Shader = new Shader(code);
shader.data.src.input = src;
shader.data.src.width = 256; // e.g.
shader.data.src.height = src.length/4/256;

var res:ByteArray = new ByteArray();
res.endian = Endian.LITTLE_ENDIAN;

var job:ShaderJob = new ShaderJob(shader, res, 256, src.length/4/256);
job.start(true);

res.position = 0;
for(var i:uint = 0; i&lt;src.length/4; i++)
{
    x = res.readFloat();
    y = res.readFloat();
    z = res.readFloat();
}</pre>
<p>Lets have a look at how pixel bender handles input and outputs. As with current version of pixel bender/flash player it seems like:</p>
<pre class="brush: plain;">'res' : cannot have 1 or 2 channel outputs</pre>
<p>&#8230; but you can use 3 or 4 channel outputs (float3, pixel3).</p>
<pre class="brush: xml;">&lt;languageVersion : 1.0;&gt;
kernel threed &lt;namespace : &quot;sk.yoz&quot;;vendor : &quot;Yoz&quot;;version : 1;&gt;
{
    input image3 src;
    output float3 res; // or pixel3
    void evaluatePixel()
    {
        res = sample(src, outCoord());
        // we have res.x, res.y and res.z
    }
}</pre>
<p>Where to go from here:</p>
<ul>
<li><a href="http://www.flashmagazine.com/tutorials/detail/using_pixel_bender_to_calculate_information/">Using Pixel Bender to calculate information</a></li>
<li><a href="http://www.huesforalice.com/project/47">Number crunching with as3 and pixelbender</a></li>
<li><a href="http://www.adobe.com/devnet/flex/articles/flashbuilder4_pixelbender.html">Using Pixel Bender with Flash Builder 4 as a number crunching engine</a></li>
<li><a href="http://www.unitzeroone.com/blog/2009/03/18/flash-10-massive-amounts-of-3d-particles-with-alchemy-source-included/">Flash 10, Massive amounts of 3D particles with Alchemy (source included).</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2010/08/pixel-bender-inputs-vector-or-bytearray/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>RTMFP Connection Tester</title>
		<link>http://blog.yoz.sk/2010/07/rtmfp-connection-tester/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=rtmfp-connection-tester</link>
		<comments>http://blog.yoz.sk/2010/07/rtmfp-connection-tester/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 11:45:27 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[connection]]></category>
		<category><![CDATA[NetConnection]]></category>
		<category><![CDATA[NetGroup]]></category>
		<category><![CDATA[NetStream]]></category>
		<category><![CDATA[port]]></category>
		<category><![CDATA[RTMFP]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=2086</guid>
		<description><![CDATA[Having problems connecting RTMFP? Use this application to test NetConnection, NetStream, NetGroup connection and publishing status. For success connection, opened UDP ports in range 1024..65535 required. Run two instances to test NetGroup neighboring. The code behind testing application: &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;s:Application xmlns:fx=&#34;http://ns.adobe.com/mxml/2009&#34; xmlns:s=&#34;library://ns.adobe.com/flex/spark&#34; xmlns:mx=&#34;library://ns.adobe.com/flex/mx&#34; width=&#34;100%&#34; height=&#34;100%&#34; applicationComplete=&#34;init()&#34;&#62; &#60;s:layout&#62; &#60;s:HorizontalLayout/&#62; &#60;/s:layout&#62; &#60;fx:Script&#62; &#60;![CDATA[ import flash.net.navigateToURL; [...]]]></description>
			<content:encoded><![CDATA[<p>Having problems connecting <a href="http://en.wikipedia.org/wiki/Real_Time_Media_Flow_Protocol">RTMFP</a>? Use this application to test NetConnection, NetStream, NetGroup connection and publishing status. For success connection, opened <a href="http://blog.yoz.sk/2010/06/quick-tip-ports-required-for-rtmfp/">UDP ports in range 1024..65535 required</a>. Run two instances to test NetGroup neighboring.</p>
<p><iframe src="http://blog.yoz.sk/examples/RTMFPTester/" width="100%" height="150" style="border:none;"></iframe><br />
<iframe src="http://blog.yoz.sk/examples/RTMFPTester/" width="100%" height="150" style="border:none;"></iframe></p>
<p><span id="more-2086"></span></p>
<p>The code behind testing application:</p>
<pre class="brush: xml;">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;s:Application xmlns:fx=&quot;http://ns.adobe.com/mxml/2009&quot;
    xmlns:s=&quot;library://ns.adobe.com/flex/spark&quot;
    xmlns:mx=&quot;library://ns.adobe.com/flex/mx&quot;
    width=&quot;100%&quot; height=&quot;100%&quot; applicationComplete=&quot;init()&quot;&gt;
&lt;s:layout&gt;
    &lt;s:HorizontalLayout/&gt;
&lt;/s:layout&gt;
&lt;fx:Script&gt;
&lt;![CDATA[
    import flash.net.navigateToURL;

    import org.osmf.net.NetConnectionCodes;
    import org.osmf.net.NetStreamCodes;
    private static const HANDSHAKE_URL:String = &quot;rtmfp://stratus.rtmfp.net&quot;;
    private static const DEVELOPER_KEY:String = &quot;PUT***YOUR***OWN&quot;;

    private var netConnection:NetConnection = new NetConnection();
    private var netStream:NetStream;
    private var netStream2:NetStream;
    private var netGroup:NetGroup;
    private var d0:Date

    private function init():void
    {
        d0 = new Date();
        netConnection.connect(HANDSHAKE_URL + &quot;/&quot; + DEVELOPER_KEY);
        netConnection.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
    }

    private function netConnectionConnected():void
    {
        var groupSpecifier:GroupSpecifier = new GroupSpecifier(&quot;somegruop&quot;);
        groupSpecifier.serverChannelEnabled = true;
        groupSpecifier.multicastEnabled = true;
        groupSpecifier.ipMulticastMemberUpdatesEnabled = true;
        groupSpecifier.postingEnabled = true;
        var groupspec:String = groupSpecifier.groupspecWithAuthorizations();

        netStream = new NetStream(netConnection, groupspec);
        netStream.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
        netStream2 = new NetStream(netConnection, groupspec);
        netStream2.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
        netGroup = new NetGroup(netConnection, groupspec);
        netGroup.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
    }

    private function onNetStatus(event:NetStatusEvent):void
    {
        var code:String = event.info.code;
        var time:Number = Math.round((new Date().time - d0.time)/10) / 100;
        log.appendText(code + &quot; (&quot; + time + &quot; sec)\n&quot;);
        switch(code)
        {
            case NetConnectionCodes.CONNECT_SUCCESS:
                netConnectionCheckBox.selected = true;
                netConnectionConnected();
                break;
            case &quot;NetStream.Connect.Success&quot;:
                if(event.info.stream == netStream)
                {
                    netStreamCheckBox.selected = true;
                    netStream.publish(&quot;test&quot;);
                }
                else if(event.info.stream == netStream2)
                {
                    netStream2.play(&quot;test&quot;);
                }
                break;
            case &quot;NetGroup.Connect.Success&quot;:
                netGroupCheckBox.selected = true;
                break;
            case NetStreamCodes.NETSTREAM_PUBLISH_START:
                netStreamPublishCheckBox.selected = true;
                break;
            case NetStreamCodes.NETSTREAM_PLAY_START:
                netStreamPlayCheckBox.selected = true;
                break;
            case &quot;NetGroup.Neighbor.Connect&quot;:
                netGroupNeighborCheckBox.selected = true;
                break;
        }
    }

    private function onReadMore():void
    {
        var url:String = &quot;http://blog.yoz.sk/2010/06/quick-tip-ports-required-for-rtmfp/&quot;;
        navigateToURL(new URLRequest(url), &quot;_blank&quot;);
    }
]]&gt;
&lt;/fx:Script&gt;
&lt;fx:Declarations&gt;
    &lt;!-- Place non-visual elements (e.g., services, value objects) here --&gt;
&lt;/fx:Declarations&gt;
&lt;s:VGroup&gt;
    &lt;s:HGroup verticalAlign=&quot;middle&quot;&gt;
        &lt;s:CheckBox id=&quot;netConnectionCheckBox&quot; enabled=&quot;false&quot;/&gt;
        &lt;s:Label text=&quot;NetConnection&quot; /&gt;
    &lt;/s:HGroup&gt;
    &lt;s:HGroup verticalAlign=&quot;middle&quot;&gt;
        &lt;s:CheckBox id=&quot;netStreamCheckBox&quot; enabled=&quot;false&quot;/&gt;
        &lt;s:Label text=&quot;NetStream&quot; /&gt;
    &lt;/s:HGroup&gt;
    &lt;s:HGroup verticalAlign=&quot;middle&quot; paddingLeft=&quot;10&quot;&gt;
        &lt;s:CheckBox id=&quot;netStreamPublishCheckBox&quot; enabled=&quot;false&quot;/&gt;
        &lt;s:Label text=&quot;NetStream.Publish&quot; /&gt;
    &lt;/s:HGroup&gt;
    &lt;s:HGroup verticalAlign=&quot;middle&quot; paddingLeft=&quot;10&quot;&gt;
        &lt;s:CheckBox id=&quot;netStreamPlayCheckBox&quot; enabled=&quot;false&quot;/&gt;
        &lt;s:Label text=&quot;NetStream.Play&quot; /&gt;
    &lt;/s:HGroup&gt;
    &lt;s:HGroup verticalAlign=&quot;middle&quot;&gt;
        &lt;s:CheckBox id=&quot;netGroupCheckBox&quot; enabled=&quot;false&quot;/&gt;
        &lt;s:Label text=&quot;NetGroup&quot; /&gt;
    &lt;/s:HGroup&gt;
    &lt;s:HGroup verticalAlign=&quot;middle&quot; paddingLeft=&quot;10&quot;&gt;
        &lt;s:CheckBox id=&quot;netGroupNeighborCheckBox&quot; enabled=&quot;false&quot;/&gt;
        &lt;s:Label text=&quot;NetGroup.Neighbor&quot; /&gt;
    &lt;/s:HGroup&gt;
&lt;/s:VGroup&gt;
&lt;s:VGroup width=&quot;100%&quot; height=&quot;100%&quot;&gt;
    &lt;s:TextArea id=&quot;log&quot; width=&quot;100%&quot; height=&quot;100%&quot; text=&quot;For success connection, opened UDP ports in range 1024..65535 required.&amp;#13;Run two instances to test NetGroup neighboring.&amp;#13;&quot; /&gt;
    &lt;s:Button label=&quot;Read more about RTMFP requirements&quot; click=&quot;onReadMore()&quot;/&gt;
&lt;/s:VGroup&gt;
&lt;/s:Application&gt;
</pre>
<p>Where to go from here:</p>
<ul>
<li><a href="http://blog.yoz.sk/2010/06/quick-tip-ports-required-for-rtmfp/">Quick tip: Ports Required For RTMFP</a></li>
<li><a href="http://cc.rtmfp.net/">RTMFP Connectivity Checker</a></li>
<li><a href="http://flashcomguru.com/apps/port_test/">RTMP and RTMPT tester</a></li>
<li><a href="http://kb2.adobe.com/cps/164/tn_16466.html">Adobe Flash Media Server port connectivity survey (HTTP tunneling)</a></li>
<li><a href="http://www.jakehilton.com/?q=node/43">Port tester for Flash Media Server and Wowza Media Server</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2010/07/rtmfp-connection-tester/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
