<?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 &#187; solution</title>
	<atom:link href="http://blog.yoz.sk/tag/solution/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.yoz.sk</link>
	<description>My life, my work</description>
	<lastBuildDate>Tue, 31 Jan 2012 12:40:53 +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>9 slice scale for bitmaps in flash (no hacks)</title>
		<link>http://blog.yoz.sk/2009/11/9-slice-scale-for-bitmaps-in-flash-no-hacks/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=9-slice-scale-for-bitmaps-in-flash-no-hacks</link>
		<comments>http://blog.yoz.sk/2009/11/9-slice-scale-for-bitmaps-in-flash-no-hacks/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 10:37:22 +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[9 slice scale]]></category>
		<category><![CDATA[Bitmap]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[solution]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=645</guid>
		<description><![CDATA[9 slice scale is a nice feature, but when you try to use 9 slice in flash ide on MovieClip with bitmap, you will notice a problem. It will just not work as expected. So first thing you try is &#8220;Break Apart&#8221;, with same result. You are almost there, but due to the solution is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.yoz.sk/wp-content/uploads/9slice_result_flash.png"><img src="http://blog.yoz.sk/wp-content/uploads/9slice_result_flash-200x168.png" alt="9slice_result_flash" title="9slice_result_flash" width="200" height="168" class="alignleft size-medium wp-image-649" /></a></p>
<p><a href="http://www.adobe.com/devnet/flex/quickstart/embedding_assets/#EmbeddingImagesScale9">9 slice scale</a> is a nice feature, but when you try to use 9 slice in flash ide on MovieClip with bitmap, you will notice a problem. It will just not work as expected. So first thing you try is &#8220;Break Apart&#8221;, with same result. You are almost there, but due to the solution is not documented you need a small hint: After break apart (ctrl + b), select each of nine slices one by one and group (ctrl + g) individually and voilà its done. See snapshot and result images&#8230;</p>
<div style="clear:both"></div>
<p><span id="more-645"></span></p>
<p>1. original image.png</p>
<p><a href="http://blog.yoz.sk/wp-content/uploads/9slice_image.png"><img src="http://blog.yoz.sk/wp-content/uploads/9slice_image.png" alt="9slice_image" title="9slice_image" width="30" height="30" class="alignnone size-full wp-image-646" /></a></p>
<p>2. <strong>symbol</strong> after break apart</p>
<p><a href="http://blog.yoz.sk/wp-content/uploads/9slice_flash_bitmap_break.png"><img src="http://blog.yoz.sk/wp-content/uploads/9slice_flash_bitmap_break.png" alt="9slice_flash_bitmap_break" title="9slice_flash_bitmap_break" width="207" height="180" class="alignnone size-full wp-image-647" /></a></p>
<p>3. <strong>symbol2</strong> after break apart and individual grouping</p>
<p><a href="http://blog.yoz.sk/wp-content/uploads/9slice_flash_bitmap.png"><img src="http://blog.yoz.sk/wp-content/uploads/9slice_flash_bitmap.png" alt="9slice_flash_bitmap" title="9slice_flash_bitmap" width="210" height="181" class="alignnone size-full wp-image-648" /></a></p>
<p>4. result in flash cs4 ide <strong>symbol</strong>, <strong>symbol2</strong></p>
<p><a href="http://blog.yoz.sk/wp-content/uploads/9slice_result_flash.png"><img src="http://blog.yoz.sk/wp-content/uploads/9slice_result_flash.png" alt="9slice_result_flash" title="9slice_result_flash" width="326" height="274" class="alignnone size-full wp-image-649" /></a></p>
<p>5. 9 slice scale in flex (maintainAspectRatio used just for purpose, no impact on 9 slice scale)</p>
<pre class="brush: xml; title: ; notranslate">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;horizontal&quot;&gt;
&lt;mx:Script&gt;
&lt;![CDATA[
    [Embed(source=&quot;image.png&quot;,
        scaleGridTop=&quot;5&quot;, scaleGridBottom=&quot;15&quot;,
        scaleGridLeft=&quot;5&quot;, scaleGridRight=&quot;15&quot;)]
    public static const imageClass:Class;

    [Embed(source=&quot;lib.swf&quot;, symbol=&quot;symbol&quot;)]
    public static const symbolClass:Class;

    [Embed(source=&quot;lib.swf&quot;, symbol=&quot;symbol2&quot;)]
    public static const symbol2Class:Class;
]]&gt;
&lt;/mx:Script&gt;
&lt;mx:Image width=&quot;100&quot; height=&quot;200&quot; source=&quot;{imageClass}&quot;
    maintainAspectRatio=&quot;false&quot;/&gt;
&lt;mx:Image width=&quot;100&quot; height=&quot;200&quot; source=&quot;{symbolClass}&quot;
    maintainAspectRatio=&quot;false&quot;/&gt;
&lt;mx:Image width=&quot;100&quot; height=&quot;200&quot; source=&quot;{symbol2Class}&quot;
    maintainAspectRatio=&quot;false&quot;/&gt;
&lt;/mx:Application&gt;</pre>
<p>6. result from flex</p>
<p><a href="http://blog.yoz.sk/wp-content/uploads/9slice_result_flex.png"><img src="http://blog.yoz.sk/wp-content/uploads/9slice_result_flex.png" alt="9slice_result_flex" title="9slice_result_flex" width="357" height="231" class="alignnone size-full wp-image-652" /></a></p>
<p>gSkinner released <a href="http://www.gskinner.com/blog/archives/2010/04/bitmapslice9_sc.html">BitmapSlice9 command for Flash Pro</a>. It makes all this happen by one click.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2009/11/9-slice-scale-for-bitmaps-in-flash-no-hacks/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>FB.Connect.showPermissionDialog</title>
		<link>http://blog.yoz.sk/2009/10/fb-connect-showpermissiondialog/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=fb-connect-showpermissiondialog</link>
		<comments>http://blog.yoz.sk/2009/10/fb-connect-showpermissiondialog/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 13:01:08 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[facebook api]]></category>
		<category><![CDATA[solution]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=385</guid>
		<description><![CDATA[If your facebook iframe applications need extra permissions granted, you can use Facebook JavaScript Api to generate modal window over your content to request permissions from users. For this purpose I created a simple FB_test_perm() function. It takes 4 arguments: api_key &#8211; your application api key xd_receiver &#8211; path to xd_receiver.htm file (Cross-Domain Receiver Page) [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.yoz.sk/wp-content/uploads/facebookpermissions.png"><img src="http://blog.yoz.sk/wp-content/uploads/facebookpermissions-200x176.png" alt="facebookpermissions" title="facebookpermissions" width="200" height="176" class="alignleft size-medium wp-image-450" /></a></p>
<p>If your facebook iframe applications need extra permissions granted, you can use Facebook JavaScript Api to generate modal window over your content to request permissions from users. For this purpose I created a simple FB_test_perm() function. It takes 4 arguments:</p>
<ul style="float:left;">
<li><strong>api_key</strong> &#8211; your application api key</li>
<li><strong>xd_receiver</strong> &#8211; path to xd_receiver.htm file (<a href="http://wiki.developers.facebook.com/index.php/Cross_Domain_Communication_Channel">Cross-Domain Receiver Page</a>)</li>
<li><strong>permission</strong> &#8211; <a href="http://wiki.developers.facebook.com/index.php/Extended_permission">publish_stream, read_stream &#8230;</a></li>
<li><strong>callback</strong> &#8211; your function with boolean return (true if permission granted, false if not granted)</li>
</ul>
<div style="clear:both;"></div>
<p><span id="more-385"></span></p>
<p>facebook_permission_test.js</p>
<pre class="brush: jscript; title: ; notranslate">function FB_test_perm(api_key, xd_receiver, permission, callback)
{
	FB.Bootstrap.requireFeatures([&quot;Connect&quot;], function()
	{
		FB.Facebook.init(api_key, xd_receiver);
		FB.Connect.requireSession(function()
		{
			FB.Facebook.apiClient.users_hasAppPermission(permission, function(result)
			{
				if (result != 0)
					return callback(true);

				FB.Connect.showPermissionDialog(permission, function(result)
				{
					return callback(result == null ? false : (result.indexOf(permission) != -1));
				}, true, null);
			});
		});
	});
}</pre>
<p>index.html</p>
<pre class="brush: xml; title: ; notranslate">&lt;html&gt;
&lt;body&gt;
&lt;script src=&quot;http://static.ak.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;facebook_permission_test.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
	function FB_perm_result(value){
		alert(value ? &quot;granted&quot; : &quot;not granted&quot;);
	}
	FB_test_perm(&quot;***&quot;, &quot;xd_receiver.htm&quot;, &quot;publish_stream&quot;, FB_perm_result);
&lt;/script&gt;
&lt;!-- Note: Include this div markup as a workaround for a known bug in this release on IE where you may get a &quot;operation aborted&quot; error --&gt;
&lt;div id=&quot;FB_HiddenIFrameContainer&quot; style=&quot;display:none; position:absolute; left:-100px; top:-100px; width:0px; height: 0px;&quot;&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>xd_receiver.htm</p>
<pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;
   &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &gt;
&lt;head&gt;
    &lt;title&gt;Cross-Domain Receiver Page&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;script src=&quot;http://static.ak.facebook.com/js/api_lib/v0.4/XdCommReceiver.js?v2&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>If you can not get your facebook showPermissionDialog popup opened, make sure you set Canvas Callback URL, Connect URL, Base domain, Connect Preview URL correctly:</p>
<p><a href="http://blog.yoz.sk/wp-content/uploads/Clipboard011.png"><img src="http://blog.yoz.sk/wp-content/uploads/Clipboard011-143x200.png" alt="Clipboard01" title="Clipboard01" width="143" height="200" class="alignnone size-medium wp-image-386" /></a></p>
<p>Make sure you embed flash in transparent / opaque wmode and iframe size (width, height) is enough to display facebook modal window.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2009/10/fb-connect-showpermissiondialog/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>SharedObject goes RangeError: Error #2006</title>
		<link>http://blog.yoz.sk/2009/10/sharedobject-goes-rangeerror-error-2006/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sharedobject-goes-rangeerror-error-2006</link>
		<comments>http://blog.yoz.sk/2009/10/sharedobject-goes-rangeerror-error-2006/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 20:29:59 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[Flash Media Server]]></category>
		<category><![CDATA[serialize]]></category>
		<category><![CDATA[SharedObject]]></category>
		<category><![CDATA[solution]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=229</guid>
		<description><![CDATA[If you keep getting RangeError: Error #2006: The supplied index is out of bounds. with SharedObject, you probably not gonna fix it. In my case this happend when I tried to write non primitive values too frequently into persistant SharedObject&#8217;s properties. After reconnect, before any event from your SharedObject dispatched, you get exception that will [...]]]></description>
			<content:encoded><![CDATA[<p>If you keep getting <em>RangeError: Error #2006: The supplied index is out of bounds.</em> with SharedObject, you probably not gonna fix it. In my case this happend when I tried to write non primitive values too frequently into persistant SharedObject&#8217;s properties. After reconnect, before any event from your SharedObject dispatched, you get exception that will cause browser crash.</p>
<p>I was not able to solve it by excluding saving advanced objects, nor by using just simple Objects, AMF0 or AMF3, nor by any other method I imagined. <a href="http://blog.yoz.sk/2009/10/serialization/">To solve the problem I decided to write only serialized objects (strings)</a> and deserialize again on client after synchronization.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2009/10/sharedobject-goes-rangeerror-error-2006/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

