<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: How not to hate SWF libraries</title>
	<atom:link href="http://lostinactionscript.com/2010/03/06/how-not-to-hate-swf-libraries/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostinactionscript.com/2010/03/06/how-not-to-hate-swf-libraries/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-not-to-hate-swf-libraries</link>
	<description>Lost In Actionscript</description>
	<lastBuildDate>Thu, 19 Jan 2012 22:32:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Shane McCartney</title>
		<link>http://lostinactionscript.com/2010/03/06/how-not-to-hate-swf-libraries/comment-page-1/#comment-2789</link>
		<dc:creator>Shane McCartney</dc:creator>
		<pubDate>Thu, 16 Jun 2011 12:16:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.lostinactionscript.com/?p=336#comment-2789</guid>
		<description>@justinG Just either double click the JSFL file or drag onto the application icon and then the script will run. You can edit the JSFL too in the Flash IDE or editor of preference.</description>
		<content:encoded><![CDATA[<p>@justinG Just either double click the JSFL file or drag onto the application icon and then the script will run. You can edit the JSFL too in the Flash IDE or editor of preference.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pavel fljot</title>
		<link>http://lostinactionscript.com/2010/03/06/how-not-to-hate-swf-libraries/comment-page-1/#comment-2788</link>
		<dc:creator>Pavel fljot</dc:creator>
		<pubDate>Thu, 16 Jun 2011 11:45:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.lostinactionscript.com/?p=336#comment-2788</guid>
		<description>Forgot to mention (notice), that approach4 DOES NOT require you to recompile SWC each time you change some code, since there&#039;s NO code in SWC. Recompile SWC only when update some graphics in FLA.</description>
		<content:encoded><![CDATA[<p>Forgot to mention (notice), that approach4 DOES NOT require you to recompile SWC each time you change some code, since there&#8217;s NO code in SWC. Recompile SWC only when update some graphics in FLA.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pavel fljot</title>
		<link>http://lostinactionscript.com/2010/03/06/how-not-to-hate-swf-libraries/comment-page-1/#comment-2787</link>
		<dc:creator>Pavel fljot</dc:creator>
		<pubDate>Thu, 16 Jun 2011 10:45:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.lostinactionscript.com/?p=336#comment-2787</guid>
		<description>Hej Shane.

Regarding &quot;linking library assets to already existing Classes&quot;.

How do u compose deep-nested display objects? Let&#039;s say designer draws a hand-made quiz set (some code needed for this object), where there are some question-answers objects, each is a complex component (with some code to be in there aswell). If u would develop this in Flash IDE u would just assign base classes for all those quiz-sets and for each answer objects. But when developing in a normal code IDE (FDT, FB, IntelliJ, FD, etc) and compiling with mxmlc Ã¢â‚¬â€ u can&#039;t really* (NB! Actually u can, explained below) use this workflow. To sum up them:

1. Export to SWC/SWF, don&#039;t use any base classes. Extend assets to add some code.
pros:
+ designer is 100% independent from code stuff.
+ [SWC] no need to load any external SWFs Ã¢â‚¬â€ classes are ready-to-use at startup.
+ [SWF] no need to recompile main app to update graphics (since they&#039;re being loaded in runtime)
cons:
- your custom classes (MyAssetWithCode extends GraphicalAsset) can&#039;t be any but Sprite/MovieClip (I mean u can&#039;t make it be some UIComponent)
- no nested layouts
- multiple assets can&#039;t inherit same code base (well that&#039;s because code extends graphics)
- [SWC] recompile to update graphics
- [SWF] need a bit of extra functionality to load SWFs


2. Export to SWC/SWF, don&#039;t use any base classes. Use composition to add graphics to your coded objects.
pros:
+ designer is 100% independent from code stuff.
+ same about loading as in CASE.1
cons:
- no nested layouts
- same about loading as in CASE.1


3. Write [Embed(source=&quot;/assets.swf#MySymbol&quot;)] just above class definition.
pros:
+ nested layouts are possible
cons:
- compiler doesn&#039;t work correctly when using incremental compile, e.g. code-asset are not successfully paired sometimes. So u have to reset compiler/forget about incremental compiling, which is awful.
- if u want N assets to have same base class, u have to manually create N classes and extend them from MyBaseClass
- recompile to update graphics


I personally used CASE.3 during some small period in my work, but finally found it very unfriendly.
I can&#039;t imagine how to use 1&amp;2 regarding layouts. I mean if u have some handmade custom layout from designer (it depends on kind of project, but I have it all the time), then there should be some markers where to put objects. Then you have to create all of them in runtime, transform, apply filters if needed (NB! regarding &quot;composition&quot;. I think it&#039;s better not to put the asset itself, but directly add children. For performance we have to keep as low depth of nesting as possible) and so on... In addition designer won&#039;t be happy to put markers instead of actual objects since it&#039;s not quite visible what will you get... Any hints regarding this workflow maybe, anyone? Because it looks like the best (the most flexible) approach, but this layout makes me feel sad.


* So for now I have a 4th CASE. This one fully mimics workflow you had in Flash IDE. I use it 
4. Export to SWC, set class to &quot;assets.MySymbolAsset&quot; and base class to &quot;projectPackage.MySymbol&quot;. The FLA has to see classpath where you have projectPackage.MySymbol class, so in my case fla file is located in /libs/fla folder and has class path &quot;.;../../src&quot;. The main trick happens when you publish to SWC. I have a special JSFL script that creates a temp folder &quot;code&quot; in the same folder where FLA is, updates FLA settings by adding this folder into classpath (as primary, first one), then creates dummy empty classes in this temp folder for each symbol that has base class, and finally compiles SWC. So the resulting SWC has NO actual code inside, but an empty classes with the same name as the real ones. This JSFL script also allows designer to compile it.
Next about compiling the application itself. Since graphical assets have the same classes names as the real ones with actual code, the actual code kinda injected into assets. This eliminates all the cons from the other mentioned cases, e.g. you have deep nested structures with an actual code for each components.
But there&#039;s basically two cons:
- you can&#039;t distribute assets into several SWC this way if some reference classes present in both. E.g. if Asset1 from assets1.swc extends MyComponent and Asset2 from assets2.swc extends MyComponent Ã¢â‚¬â€ u&#039;re screwed.
- base classes from fla should have the same name as the real ones, so if your fancy IDE has a nice refactoring support Ã¢â‚¬â€ u&#039;re lucky. But still have to change everything in FLA somehow (manually/JSFL).

More about this workflow. To create a new object it&#039;s handy to write this way:
var foo:MyComponent = new MyComponentAsset(); // remember that MyComponentAsset extends MyComponent. MyComponentAsset is dynamic (due to FlashIDE), but MyComponent is not.



So again, any tips on comfortable composing layouts with workflows 1 and 2? Because they seem like more &quot;right&quot;.</description>
		<content:encoded><![CDATA[<p>Hej Shane.</p>
<p>Regarding &#8220;linking library assets to already existing Classes&#8221;.</p>
<p>How do u compose deep-nested display objects? Let&#8217;s say designer draws a hand-made quiz set (some code needed for this object), where there are some question-answers objects, each is a complex component (with some code to be in there aswell). If u would develop this in Flash IDE u would just assign base classes for all those quiz-sets and for each answer objects. But when developing in a normal code IDE (FDT, FB, IntelliJ, FD, etc) and compiling with mxmlc Ã¢â‚¬â€ u can&#8217;t really* (NB! Actually u can, explained below) use this workflow. To sum up them:</p>
<p>1. Export to SWC/SWF, don&#8217;t use any base classes. Extend assets to add some code.<br />
pros:<br />
+ designer is 100% independent from code stuff.<br />
+ [SWC] no need to load any external SWFs Ã¢â‚¬â€ classes are ready-to-use at startup.<br />
+ [SWF] no need to recompile main app to update graphics (since they&#8217;re being loaded in runtime)<br />
cons:<br />
- your custom classes (MyAssetWithCode extends GraphicalAsset) can&#8217;t be any but Sprite/MovieClip (I mean u can&#8217;t make it be some UIComponent)<br />
- no nested layouts<br />
- multiple assets can&#8217;t inherit same code base (well that&#8217;s because code extends graphics)<br />
- [SWC] recompile to update graphics<br />
- [SWF] need a bit of extra functionality to load SWFs</p>
<p>2. Export to SWC/SWF, don&#8217;t use any base classes. Use composition to add graphics to your coded objects.<br />
pros:<br />
+ designer is 100% independent from code stuff.<br />
+ same about loading as in CASE.1<br />
cons:<br />
- no nested layouts<br />
- same about loading as in CASE.1</p>
<p>3. Write [Embed(source="/assets.swf#MySymbol")] just above class definition.<br />
pros:<br />
+ nested layouts are possible<br />
cons:<br />
- compiler doesn&#8217;t work correctly when using incremental compile, e.g. code-asset are not successfully paired sometimes. So u have to reset compiler/forget about incremental compiling, which is awful.<br />
- if u want N assets to have same base class, u have to manually create N classes and extend them from MyBaseClass<br />
- recompile to update graphics</p>
<p>I personally used CASE.3 during some small period in my work, but finally found it very unfriendly.<br />
I can&#8217;t imagine how to use 1&amp;2 regarding layouts. I mean if u have some handmade custom layout from designer (it depends on kind of project, but I have it all the time), then there should be some markers where to put objects. Then you have to create all of them in runtime, transform, apply filters if needed (NB! regarding &#8220;composition&#8221;. I think it&#8217;s better not to put the asset itself, but directly add children. For performance we have to keep as low depth of nesting as possible) and so on&#8230; In addition designer won&#8217;t be happy to put markers instead of actual objects since it&#8217;s not quite visible what will you get&#8230; Any hints regarding this workflow maybe, anyone? Because it looks like the best (the most flexible) approach, but this layout makes me feel sad.</p>
<p>* So for now I have a 4th CASE. This one fully mimics workflow you had in Flash IDE. I use it<br />
4. Export to SWC, set class to &#8220;assets.MySymbolAsset&#8221; and base class to &#8220;projectPackage.MySymbol&#8221;. The FLA has to see classpath where you have projectPackage.MySymbol class, so in my case fla file is located in /libs/fla folder and has class path &#8220;.;../../src&#8221;. The main trick happens when you publish to SWC. I have a special JSFL script that creates a temp folder &#8220;code&#8221; in the same folder where FLA is, updates FLA settings by adding this folder into classpath (as primary, first one), then creates dummy empty classes in this temp folder for each symbol that has base class, and finally compiles SWC. So the resulting SWC has NO actual code inside, but an empty classes with the same name as the real ones. This JSFL script also allows designer to compile it.<br />
Next about compiling the application itself. Since graphical assets have the same classes names as the real ones with actual code, the actual code kinda injected into assets. This eliminates all the cons from the other mentioned cases, e.g. you have deep nested structures with an actual code for each components.<br />
But there&#8217;s basically two cons:<br />
- you can&#8217;t distribute assets into several SWC this way if some reference classes present in both. E.g. if Asset1 from assets1.swc extends MyComponent and Asset2 from assets2.swc extends MyComponent Ã¢â‚¬â€ u&#8217;re screwed.<br />
- base classes from fla should have the same name as the real ones, so if your fancy IDE has a nice refactoring support Ã¢â‚¬â€ u&#8217;re lucky. But still have to change everything in FLA somehow (manually/JSFL).</p>
<p>More about this workflow. To create a new object it&#8217;s handy to write this way:<br />
var foo:MyComponent = new MyComponentAsset(); // remember that MyComponentAsset extends MyComponent. MyComponentAsset is dynamic (due to FlashIDE), but MyComponent is not.</p>
<p>So again, any tips on comfortable composing layouts with workflows 1 and 2? Because they seem like more &#8220;right&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JustinG</title>
		<link>http://lostinactionscript.com/2010/03/06/how-not-to-hate-swf-libraries/comment-page-1/#comment-2786</link>
		<dc:creator>JustinG</dc:creator>
		<pubDate>Wed, 15 Jun 2011 18:09:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.lostinactionscript.com/?p=336#comment-2786</guid>
		<description>Great! This is exactly what I was looking for. How exactly do you use this though? I&#039;m new to JSFL and still trying to figure out what it can and how to use it.</description>
		<content:encoded><![CDATA[<p>Great! This is exactly what I was looking for. How exactly do you use this though? I&#8217;m new to JSFL and still trying to figure out what it can and how to use it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Minor</title>
		<link>http://lostinactionscript.com/2010/03/06/how-not-to-hate-swf-libraries/comment-page-1/#comment-2779</link>
		<dc:creator>Michael Minor</dc:creator>
		<pubDate>Thu, 12 May 2011 17:27:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.lostinactionscript.com/?p=336#comment-2779</guid>
		<description>I found some errors when saving out the class name... It wasn&#039;t adding a &quot;/&quot; between the folder you store your classes, and the first folder based off the package name...

Fix @ http://dl.dropbox.com/u/2400762/Adobe/Commands/Export%20Library%20References.jsfl</description>
		<content:encoded><![CDATA[<p>I found some errors when saving out the class name&#8230; It wasn&#8217;t adding a &#8220;/&#8221; between the folder you store your classes, and the first folder based off the package name&#8230;</p>
<p>Fix @ <a href="http://dl.dropbox.com/u/2400762/Adobe/Commands/Export%20Library%20References.jsfl" rel="nofollow">http://dl.dropbox.com/u/2400762/Adobe/Commands/Export%20Library%20References.jsfl</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy</title>
		<link>http://lostinactionscript.com/2010/03/06/how-not-to-hate-swf-libraries/comment-page-1/#comment-2741</link>
		<dc:creator>Jeremy</dc:creator>
		<pubDate>Fri, 05 Nov 2010 12:15:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.lostinactionscript.com/?p=336#comment-2741</guid>
		<description>So is there still no better way of doing this? I&#039;m really struggling with the fact that SWC compiling takes too long and i want to use either SWC or SWF libraries on runtime.</description>
		<content:encoded><![CDATA[<p>So is there still no better way of doing this? I&#8217;m really struggling with the fact that SWC compiling takes too long and i want to use either SWC or SWF libraries on runtime.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shane McCartney</title>
		<link>http://lostinactionscript.com/2010/03/06/how-not-to-hate-swf-libraries/comment-page-1/#comment-2738</link>
		<dc:creator>Shane McCartney</dc:creator>
		<pubDate>Fri, 22 Oct 2010 23:07:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.lostinactionscript.com/?p=336#comment-2738</guid>
		<description>Well what I am referring to here &quot;just to be clear&quot; is that within a library I believe defining top or base classes on library assets is a bad programming technique. It&#039;s much better to use the ApplicationDomain and getDefinition method to extract the Class constructor and initialise assets with this technique. Reason being is that then library  swfs have no code compiled within them. This also reduces potential problems with class load order or having to think about LoaderContexts.</description>
		<content:encoded><![CDATA[<p>Well what I am referring to here &#8220;just to be clear&#8221; is that within a library I believe defining top or base classes on library assets is a bad programming technique. It&#8217;s much better to use the ApplicationDomain and getDefinition method to extract the Class constructor and initialise assets with this technique. Reason being is that then library  swfs have no code compiled within them. This also reduces potential problems with class load order or having to think about LoaderContexts.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eco_bach</title>
		<link>http://lostinactionscript.com/2010/03/06/how-not-to-hate-swf-libraries/comment-page-1/#comment-2737</link>
		<dc:creator>eco_bach</dc:creator>
		<pubDate>Fri, 15 Oct 2010 20:10:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.lostinactionscript.com/?p=336#comment-2737</guid>
		<description>re&#039;think linking library assets to already existing Classes is not a very good programming technique&#039; Shane, please elaborate.
What is your workaround when you need to associate existing classes with author time created assets?</description>
		<content:encoded><![CDATA[<p>re&#8217;think linking library assets to already existing Classes is not a very good programming technique&#8217; Shane, please elaborate.<br />
What is your workaround when you need to associate existing classes with author time created assets?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: game on jsfl~ &#171; CODE@Ã¨ÂÂ´Ã¨ÂÂ¶Ã£â‚¬â€šÃ¥Â¤Â¢</title>
		<link>http://lostinactionscript.com/2010/03/06/how-not-to-hate-swf-libraries/comment-page-1/#comment-2733</link>
		<dc:creator>game on jsfl~ &#171; CODE@Ã¨ÂÂ´Ã¨ÂÂ¶Ã£â‚¬â€šÃ¥Â¤Â¢</dc:creator>
		<pubDate>Tue, 28 Sep 2010 11:39:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.lostinactionscript.com/?p=336#comment-2733</guid>
		<description>[...] http://www.lostinactionscript.com/index.php/2010/03/06/how-not-to-hate-swf-libraries/  Filed under: Ã§Â·Â¨Ã§Â¨â€¹ Leave a comment     Comments (0) Trackbacks (0) ( subscribe to comments on this post ) [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://www.lostinactionscript.com/index.php/2010/03/06/how-not-to-hate-swf-libraries/" rel="nofollow">http://www.lostinactionscript.com/index.php/2010/03/06/how-not-to-hate-swf-libraries/</a>  Filed under: Ã§Â·Â¨Ã§Â¨â€¹ Leave a comment     Comments (0) Trackbacks (0) ( subscribe to comments on this post ) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Meat &#38; Potatoes &#171; Deceptive Resolution</title>
		<link>http://lostinactionscript.com/2010/03/06/how-not-to-hate-swf-libraries/comment-page-1/#comment-2719</link>
		<dc:creator>Meat &#38; Potatoes &#171; Deceptive Resolution</dc:creator>
		<pubDate>Fri, 10 Sep 2010 12:25:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.lostinactionscript.com/?p=336#comment-2719</guid>
		<description>[...] Better use of jsfl with swf libraries [...]</description>
		<content:encoded><![CDATA[<p>[...] Better use of jsfl with swf libraries [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.506 seconds -->

