<?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; swc</title>
	<atom:link href="http://blog.yoz.sk/tag/swc/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>Quick Tip: Flash CS Button to Flex</title>
		<link>http://blog.yoz.sk/2010/11/quick-tip-flash-cs-button-to-flex/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=quick-tip-flash-cs-button-to-flex</link>
		<comments>http://blog.yoz.sk/2010/11/quick-tip-flash-cs-button-to-flex/#comments</comments>
		<pubDate>Tue, 23 Nov 2010 14:17:18 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[embed]]></category>
		<category><![CDATA[SimpleButton]]></category>
		<category><![CDATA[swc]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=2623</guid>
		<description><![CDATA[If are trying to embed button symbols (extended SimpleButton) from Flash CS and the results are not what expected: try exporting your elements into .swc and attach into Flex project, later in code do: This may also help you capturing Event-s dispatched on custom frame from loaded MovieClips.]]></description>
			<content:encoded><![CDATA[<p>If are trying to embed button symbols (extended SimpleButton) from Flash CS and the results are not what expected:</p>
<pre class="brush: as3; title: ; notranslate">[Embed(source=&quot;assets/elements.swf&quot;, symbol=&quot;my_button&quot;)]
public static const BUTTON_CLASS:Class;
...
addChild(new BUTTON_CLASS())</pre>
<p>try exporting your elements into .swc and attach into Flex project, later in code do:</p>
<pre class="brush: as3; title: ; notranslate">public static const BUTTON_CLASS:Class = my_button;
...
addChild(new BUTTON_CLASS())</pre>
<p>This may also help you capturing Event-s dispatched on custom frame from loaded MovieClips.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2010/11/quick-tip-flash-cs-button-to-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook Extended Permissions With Authorization by Overriding Class in swc</title>
		<link>http://blog.yoz.sk/2010/01/facebook-extended-permissions-with-authorization-by-overriding-class-in-swc/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=facebook-extended-permissions-with-authorization-by-overriding-class-in-swc</link>
		<comments>http://blog.yoz.sk/2010/01/facebook-extended-permissions-with-authorization-by-overriding-class-in-swc/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 12:27:10 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[Authorization]]></category>
		<category><![CDATA[DesktopSession]]></category>
		<category><![CDATA[facebook api]]></category>
		<category><![CDATA[swc]]></category>
		<category><![CDATA[URLRequest]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=901</guid>
		<description><![CDATA[It may be not popular, but it is possible to substitute / override whole class from .swc file. Lets say you are using some public api, in our case Facebook actionscript api. I admire work of developer team, but I would like to have some things different. My facebook application requires publish_stream extended permission right [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.yoz.sk/wp-content/uploads/extendedPermissionWithLoginSmall.jpg" alt="" title="extendedPermissionWithLoginSmall" width="200" height="100" class="alignleft size-full wp-image-911" /></p>
<p>It may be not popular, but it is possible to substitute / override whole class from .swc file. Lets say you are using some public api, in our case <a href="http://code.google.com/p/facebook-actionscript-api/">Facebook actionscript api</a>. I admire work of developer team, but I would like to have some things different. My facebook application requires <a href="http://wiki.developers.facebook.com/index.php/Extended_permissions">publish_stream</a> extended permission right after user login (authorize) my application. Even if official facebook api documentation says it is possible to ask for <a href="http://wiki.developers.facebook.com/index.php/Authorization_and_Authentication_for_Desktop_Applications">extended permission with login.php</a> call (req_perms parameter), our facebook actionscript api does not offer setting this parameter.</p>
<p><span id="more-901"></span></p>
<p>After few moments of research it was clear that login.php call makes <a href="http://code.google.com/p/facebook-actionscript-api/source/browse/trunk/source/actionscript/com/facebook/session/DesktopSession.as">DesktopSession class</a>, method onLogin()&#8230;</p>
<pre class="brush: as3; title: ; notranslate">... some code ...

protected function onLogin(p_event:FacebookEvent):void {
	p_event.target.removeEventListener(FacebookEvent.COMPLETE, onLogin);

	if (p_event.success) {
		_auth_token = (p_event.data as StringResultData).value;

		//now that we have an auth_token we need the user to login with it
		var request:URLRequest = new URLRequest();
		var loginParams:String = '?';

		if (_offline_access) {
				loginParams += 'ext_perm=offline_access&amp;';
		}

		request.url = login_url+loginParams+&quot;api_key=&quot;+api_key+&quot;&amp;v=&quot;+api_version+&quot;&amp;auth_token=&quot;+_auth_token;

		navigateToURL(request, &quot;_blank&quot;);

		_waiting_for_login = true;
		dispatchEvent(new FacebookEvent(FacebookEvent.WAITING_FOR_LOGIN));
	} else {
		onConnectionError(p_event.error);
	}
}

... some code ...</pre>
<p>Now lets do the dirty work. If it were possible, I would extend DesktopSession class and override just onLogin function, but api creates and uses DesktopSession inside its whole logic, so there is no way to succeed. However, it is possible to override whole class. First, in your flex project (with facebook swc in library path), create directory structure com/facebook/session/ (the same as DesktopSession package defines), than copy <a href="http://code.google.com/p/facebook-actionscript-api/source/browse/trunk/source/actionscript/com/facebook/session/DesktopSession.as">DesktopSession.as</a> file inside. Well, thats it <img src='http://blog.yoz.sk/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  &#8230; From now, when you publish your application, compilator uses your DesktopSession instead of the one in .swc.</p>
<p>To make the new class working for my needs, onLogin function needs to be changed into something like this:</p>
<pre class="brush: as3; title: ; notranslate">... some code ...

protected function onLogin(p_event:FacebookEvent):void {
	p_event.target.removeEventListener(FacebookEvent.COMPLETE, onLogin);

	if (p_event.success) {
		_auth_token = (p_event.data as StringResultData).value;

		//now that we have an auth_token we need the user to login with it
		var request:URLRequest = new URLRequest(login_url);
		var variables:URLVariables = new URLVariables();

		variables.req_perms = 'publish_stream';
		variables.api_key = api_key;
		variables.v = api_version;
		variables.auth_token = _auth_token;
		variables.fbconnect = &quot;true&quot;;
		variables.connect_display = &quot;page&quot;;

		request.data = variables;
		navigateToURL(request, &quot;_blank&quot;);

		_waiting_for_login = true;
		dispatchEvent(new FacebookEvent(FacebookEvent.WAITING_FOR_LOGIN));
	} else {
		onConnectionError(p_event.error);
	}
}

... some code ...</pre>
<p>By asking extended permissions with login.php, facebook opens more step authorization dialog where each permissions is separated into own step and user can allow or dont allow each.</p>
<p><img src="http://blog.yoz.sk/wp-content/uploads/extendedPermissionWithLogin.jpg" alt="" title="extendedPermissionWithLogin" width="658" height="713" class="alignnone size-full wp-image-908" /></p>
<p><strong>Important:</strong></p>
<ul>
<li>Even if you send req_perms=publish_stream with login.php, facebook only accepts it when your app is live (not from your desktop testing) &#8230; Functionality already bugged in facebook bugzilla</li>
<li>Even if it is possible to override class this way, consider using it. Next time there may be newer version of .swc with some changes in your overriden class!</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2010/01/facebook-extended-permissions-with-authorization-by-overriding-class-in-swc/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Apparat (TAAS) framework to optimize swf</title>
		<link>http://blog.yoz.sk/2009/10/apparat-taas-framework-to-optimize-swf/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=apparat-taas-framework-to-optimize-swf</link>
		<comments>http://blog.yoz.sk/2009/10/apparat-taas-framework-to-optimize-swf/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 09:33:38 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Technologies]]></category>
		<category><![CDATA[Apparat]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[swc]]></category>
		<category><![CDATA[swf]]></category>
		<category><![CDATA[TAAS]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=202</guid>
		<description><![CDATA[Joa Ebert is a Flash developer with a focus on ActionScript 3. He has developed several tools helping to optimize daily workflow. Most projects have been released as open-source. The most important one is Apparat / TAAS project: Apparat is an open source framework written in Java to optimize ABC, SWC and SWF files. The [...]]]></description>
			<content:encoded><![CDATA[<p>Joa Ebert is a Flash developer with a focus on ActionScript 3. He has developed several tools helping to optimize daily workflow. Most projects have been released as open-source. The most important one is Apparat / TAAS project:</p>
<p><a href="http://code.google.com/p/apparat/">Apparat</a> is an open source framework written in Java to optimize ABC, SWC and SWF files. The core of Apparat are its three file formats and their implementation:</p>
<ul>
<li>ABC (read and write ABC files, bytecode analysis and tools)</li>
<li>SWC (read and write SWC files)</li>
<li>SWF (read and write SWF files, tag implementations)</li>
</ul>
<p><strong>TAAS</strong> is a stackless representation of the ActionScriptBytecode. Read <a href="http://blog.joa-ebert.com/2009/09/01/first-results-of-taas/">first results of TAAS</a>, and see application <a href="http://www.joa-ebert.com/swf/index.php?swf=taas/b00">before</a> and <a href="http://www.joa-ebert.com/swf/index.php?swf=taas/a00">after</a> optimization.</p>
<p><span id="more-202"></span></p>
<blockquote><p>The TAAS compiler is different from the ActionScript compiler since its input is not ActionScript source code but already compiled SWF or SWC files. Just like the haXe compiler can output AS3 instead of a SWF the TAAS compiler can do the same. Now if you add one and one together you see that the TAAS compiler can be used as a very strong decompiler. My own tests have shown that it will work flawlessly where other commercial decompilers output rubbish. Since the compiler behaves like the Flash Player it will “execute” the bytecode in order to parse it which means it has a very highlevel understanding of the structure inside the SWF. (<a href="http://blog.joa-ebert.com/2009/09/29/taas-as-a-decompiler/">Joa Ebert</a>)</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2009/10/apparat-taas-framework-to-optimize-swf/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>ActionScript 3 Classes</title>
		<link>http://blog.yoz.sk/2009/10/actionscript-3-classes/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=actionscript-3-classes</link>
		<comments>http://blog.yoz.sk/2009/10/actionscript-3-classes/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 22:22:19 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[browse]]></category>
		<category><![CDATA[classes]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[swc]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=220</guid>
		<description><![CDATA[You can always download classes used in posts here http://classes.yoz.sk/!]]></description>
			<content:encoded><![CDATA[<p>You can always download classes used in posts here <a href="http://classes.yoz.sk/">http://classes.yoz.sk/</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2009/10/actionscript-3-classes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

