<?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>Gaurav&#039;s Blog &#187; Flex Tools</title>
	<atom:link href="http://gauravj.com/blog/category/tools/feed/" rel="self" type="application/rss+xml" />
	<link>http://gauravj.com/blog</link>
	<description>Tips and Tools of Flex</description>
	<lastBuildDate>Wed, 28 Mar 2012 17:55:42 +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>Troubleshooting ActionScript Code Coverage</title>
		<link>http://gauravj.com/blog/2011/02/troubleshooting-actionscript-code-coverage/</link>
		<comments>http://gauravj.com/blog/2011/02/troubleshooting-actionscript-code-coverage/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 23:12:07 +0000</pubDate>
		<dc:creator>Gaurav</dc:creator>
				<category><![CDATA[Flex Tools]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Code Coverage]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://gauravj.com/blog/?p=896</guid>
		<description><![CDATA[<p>Sometimes folks run into situation with ActionScript code coverage plugin-in where the SWF files doesn&#8217;t make a connection. When this happens the plug-in stays in the &#8220;Listening..&#8221; status after the SWF is launched in Flash Player or AIR. Usually this happens because one the prerequisites for the tool is not being fulfilled. Before we <span style="color:#777"> . . . &#8594; Read More: <a href="http://gauravj.com/blog/2011/02/troubleshooting-actionscript-code-coverage/">Troubleshooting ActionScript Code Coverage</a></span>]]></description>
			<content:encoded><![CDATA[<p>Sometimes folks run into situation with ActionScript code coverage plugin-in where the SWF files doesn&#8217;t make a connection. When this happens the plug-in stays in the &#8220;Listening..&#8221; status after the SWF is launched in Flash Player or AIR. Usually this happens because one the prerequisites for the tool is not being fulfilled. Before we jump into the diagnosis, lets recap the prerequisites (which are listed in the <a href="http://labs.adobe.com/wiki/index.php/ActionScript_Code_Coverage:Using">docs</a>). </p>
<p><strong>Prerequisites:</strong></p>
<ul>
<li>Debug version of Flash Player</li>
<li>SWF file that has been compiled in debug mode </li>
<li>The preloaded SWF must be local trusted.</li>
</ul>
<p>Following is how you can ensure that the prerequisites are being met and possible resolutions:</p>
<p><strong>I.</strong> To ensure that you are using the debug version of flash player, you can simply compile and run the following mxml code and it should list the version and also if it supports debugging or not:</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> layout=<span style="color: #ff0000;">&quot;horizontal&quot;</span> creationComplete=<span style="color: #ff0000;">&quot;application1_creationCompleteHandler(event)&quot;</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">		&lt;![CDATA[</span>
<span style="color: #339933;">			import mx.events.FlexEvent;</span>
<span style="color: #339933;">			protected function application1_creationCompleteHandler(event:FlexEvent):void</span>
<span style="color: #339933;">			{</span>
<span style="color: #339933;">				playerVersion.text = Capabilities.version;</span>
<span style="color: #339933;">				isDebugger.text = String(Capabilities.isDebugger);</span>
<span style="color: #339933;">			}</span>
<span style="color: #339933;">		]]&gt;</span>
<span style="color: #339933;">	&lt;/mx:Script&gt;</span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> text=<span style="color: #ff0000;">&quot;Version&quot;</span><span style="color: #7400FF;">/&gt;</span><span style="color: #7400FF;">&lt;mx:Label</span> id=<span style="color: #ff0000;">&quot;playerVersion&quot;</span><span style="color: #7400FF;">/&gt;</span><span style="color: #7400FF;">&lt;mx:Label</span> text=<span style="color: #ff0000;">&quot;Supports Debugging? &quot;</span><span style="color: #7400FF;">/&gt;</span><span style="color: #7400FF;">&lt;mx:Label</span> id=<span style="color: #ff0000;">&quot;isDebugger&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

</blockquote>
<p><strong>Resolution:</strong> Reinstall debug version of flash player.</p>
<p><strong>II.</strong> To ensure that you are using the debug version of the SWF, you can run swfdump on the swf file. The swfdump generates an XML report. Look for tags like <strong>EnableDebugger2</strong> and <strong>DebugID</strong> in the report. If these tags are missing then you are probably running a release mode swf.</p>
<p><strong>Resolution:</strong> Recompile SWF with debug info. To do this from command line add -debug=true to mxmlc command. To do this from Flash builder, make sure debug is not set to false in additional compiler arguments or a local config file. </p>
<p><strong>III.</strong> To ensure that PreloadSwf is local trusted, you can follow the following steps:</p>
<ol>
<li>Run tail -f command on the mm.cfg file and then click the start button in code coverage plug-in.<br />
The mm.cfg file is present at the following location:</p>
<p><strong>XP:</strong> C:\Documents and Settings\<em>username</em><br />
<strong>Vista/Win7:</strong> C:\Users\<em>username</em><br />
<strong>Mac:</strong> /home/<em>username</em>  or if that doesn&#8217;t exist: /Library/Application Support/Macromedia</p>
<p>After you click the start button, the plugin should add a PreloadSwf entry to the mm.cfg file. <em>If it doesn&#8217;t then you should <strong>make sure that mm.cfg is writable and that the user has permissions</strong>.</em></p>
<p>An example of PreloadSwf entry:<br />
PreloadSwf=/Users/<em>username</em>/Documents/Adobe Flash Builder 4/.metadata/.plugins/com.adobe.flash.codecoverage/CodeCoverageAgent.swf?host=localhost&#038;port=9900&#038;level=0</p>
<p>Note down the absolute path of folder containing CodeCoverageAgent.swf. It should be in your FB workspace at <em>&lt;workspace&gt;/.metadata/.plugins/com.adobe.flash.codecoverage</em></p>
<p>Also the plug-in removes the PreloadSwf entry when you click the stop button</li>
<li>Inspect at the trust files.<br />
Location of trust file (per-user):<br />
<strong>XP</strong> C:\Documents and Settings\<em>username</em>\Application Data\Macromedia\Flash Player\#Security\FlashPlayerTrust<br />
<strong>Vista/Win7</strong>: C:\Users\<em>username</em>\AppData\Roaming\Macromedia\Flash Player\#Security\FlashPlayerTrust<br />
<strong>Mac:</strong> /Users/<em>username</em>/Library/Preferences/Macromedia/Flash Player/#Security/FlashPlayerTrust</p>
<p>Location of trust file (global):<br />
<strong>XP/Vista/Win7</strong> C:\WINDOWS\system32\Macromed\Flash\FlashPlayerTrust<br />
<strong>Mac</strong> /Library/Application Support/Macromedia/FlashPlayerTrust</p>
<p>The trust file is usually called flashbuilder.cfg. Make sure that the path of folder containing CodeCoverageAgent.swf is present in the trust file.
</li>
</ol>
<p><strong>Resolution:</strong> Add parent folder of CodeCoverageAgent.swf to the trust file. If the trust file is not present create a new trust file. Also it is important to restart your browser/AIR after changes to the trust file.</p>
<p>If all the prerequisites are being satisfied then make sure that the port number (9900) is free for use by code coverage plug-in. In case 9900 is not available then you should update the port number in the code coverage preferences.</p>
]]></content:encoded>
			<wfw:commentRss>http://gauravj.com/blog/2011/02/troubleshooting-actionscript-code-coverage/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>RSL enhancements in Hero</title>
		<link>http://gauravj.com/blog/2011/01/rsl-enhancement-in-hero/</link>
		<comments>http://gauravj.com/blog/2011/01/rsl-enhancement-in-hero/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 17:04:13 +0000</pubDate>
		<dc:creator>Gaurav</dc:creator>
				<category><![CDATA[Flex Framework]]></category>
		<category><![CDATA[Flex Tools]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[RSL]]></category>

		<guid isPermaLink="false">http://gauravj.com/blog/?p=830</guid>
		<description><![CDATA[<p>While RSLs help to reduce the size for your Flex applications, they can sometimes be tricky to use. So to simplify the usage of RSLs, we made some enhancements in the upcoming Flex SDK release (code-named Hero).</p> <p>These enhancements should provide the following benefits:</p> Applications will only load RSLs that are required Modules (and <span style="color:#777"> . . . &#8594; Read More: <a href="http://gauravj.com/blog/2011/01/rsl-enhancement-in-hero/">RSL enhancements in Hero</a></span>]]></description>
			<content:encoded><![CDATA[<p>While RSLs help to reduce the size for your Flex applications, they can sometimes be tricky to use. So to simplify the usage of RSLs, we made some enhancements in the upcoming Flex SDK release (code-named <a href="http://opensource.adobe.com/wiki/display/flexsdk/Hero">Hero</a>).</p>
<p>These enhancements should provide the following benefits:</p>
<ul>
<li>Applications will only load RSLs that are required</li>
<li>Modules (and sub applications) will use RSLs which are already loaded by the parent application (or module)</li>
<li>Enable sharing of RSLs between modules (and sub applications)</li>
<li>Simply usage of Monkey Patch with Flex RSLs</li>
</ul>
<h3>Only load what&#8217;s needed</h3>
<p>In Flex 4, all RSLs that were listed in the flex-config.xml (at compile time) were loaded by the app when it was launched. But with the Hero release the compiler will remove any RSLs which are not needed by your application. This means that the load time for your app should improve because it won&#8217;t load any extra RSL. The RSLs removed by the compiler will be the placeholder RSLs. This feature is controlled by a new compiler switch called <strong>-remove-unused-rsls</strong> which defaults to true.</p>
<p>Also if you compile your app using the command line compiler, then it will print the names of the RSLs that are needed by your application. The following is an example of compiler output where the app uses 3 out of the 10 RSLs listed in flex-config.xml<br />
<img alt="" src="http://www.gauravj.com/blog/examples/RSLs/RSL_feedback.png" title="RSL_feedback.png" class="aligncenter" width="803" height="72" /></p>
<p>There could be cases where the compiler may remove RSL which is needed by your app (say if you used soft-linking to load classes from a swc). If you run into such a situation then you can override the compiler&#8217;s decision, to remove the RSL, by using the <strong>-force-rsls</strong> compiler switch. This option takes the path of the swcs for which the RSLs should be force loaded.</p>
<h3>Use what&#8217;s already loaded</h3>
<p>Starting with Hero, modules and sub-applications will use the RSLs loaded by the parent app instead of loading a duplicate copy. </p>
<p>When a module or sub-application loads a new RSL, the RSL will be loaded into the default application domain and if this was the placeholder RSL for the parent app then it will be loaded into the parent&#8217;s application domain. Now if the parent app loads another module or sub-app which needs the same RSL then it will be able to use the RSL loaded by previous module or sub app.</p>
<p>The image below is an example of application where the OSMF RSL is removed by the compiler and so it becomes the placeholder RSL for the main app.<br />
<img alt="" src="http://www.gauravj.com/blog/examples/RSLs/placeholder.png" title="placeholder" class="aligncenter" width="269" height="228" /></p>
<p>In the following image, the main app loads a module that uses spark video player. The module needs OSMF RSL so it loads it into the app domain of the parent application because OSMF RSL is a placeholder RSL. The module does not load the Framework or Spark RSLs because those were already loaded by the parent app.<br />
<img alt="" src="http://www.gauravj.com/blog/examples/RSLs/moduleLoadsRSL.png" title="module loads RSL" class="aligncenter" width="269" height="230" /></p>
<p>Now if the main app loads another sub app which needs OSMF RSL, then the sub-app will simply be able to use the OSMF RSL loaded by the module. </p>
<p>You can also specify the application domain where the module should load the RSL. The <strong>-application-domain</strong> compiler option takes the path of the swc and then the name of the application domain. The valid values for application domain  are &#8216;current&#8217;, &#8216;default&#8217;, &#8216;parent&#8217;, or &#8216;top-level&#8217;</p>
<h3>Smaller Framework RSL</h3>
<p>In Hero, we also reduced the size of the framework RSL. This was done by removing all mx components from framework.swc and moving them to a separate swc called mx.swc. So if you are creating pure spark apps then you don&#8217;t need to load any mx classes. </p>
<h3>Monkey Patch RSL</h3>
<p>The only way to use monkey patches with Flex RSLs is to load monkey patched file as RSL itself. But again it was quite tedious to create a monkey patched RSL, so to simplify that a new compiler option (called <strong>-include-inheritance-dependencies-only</strong>) was added. This option can be used when compiling the monkey patched library. This options works with -include-classes flag and it only pulls dependencies which are of type inheritance. An example for usage of this option: </p>
<p><code>bin/compc -include-classes=spark.components.Button -sp=frameworks/projects/spark/src/ -include-inheritance-dependencies-only=true -output=patch.swc</code></p>
<p>In the above example, the output swc will contain spark.components.Button and only it&#8217;s inheritance dependencies. And the library.swf contained in the output swc can be used as an RSL if you were to monkey patch the spark button component.</p>
<p>Most of these changes (except for the -application-domain compiler option) are already available in the latest <a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+Hero">Hero preview build</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://gauravj.com/blog/2011/01/rsl-enhancement-in-hero/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Code Coverage Tool for ActionScript</title>
		<link>http://gauravj.com/blog/2010/09/code-coverage-tool-for-actionscript/</link>
		<comments>http://gauravj.com/blog/2010/09/code-coverage-tool-for-actionscript/#comments</comments>
		<pubDate>Thu, 30 Sep 2010 02:45:28 +0000</pubDate>
		<dc:creator>Gaurav</dc:creator>
				<category><![CDATA[Flex Tools]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Code Coverage]]></category>

		<guid isPermaLink="false">http://gauravj.com/blog/?p=800</guid>
		<description><![CDATA[<p>The prerelease for ActionScript Code Coverage Plug-in is now live on labs.adobe.com. On the Flex SDK team we use this tool to perform code coverage for the Flex Framework. This tool is not tied to any specific SDK version and so it can be used to perform code coverage using the latest SDK build. <span style="color:#777"> . . . &#8594; Read More: <a href="http://gauravj.com/blog/2010/09/code-coverage-tool-for-actionscript/">Code Coverage Tool for ActionScript</a></span>]]></description>
			<content:encoded><![CDATA[<p>The prerelease for <a href="http://labs.adobe.com/technologies/ascode_coverage/">ActionScript Code Coverage Plug-in</a> is now live on <a href="http://labs.adobe.com/">labs.adobe.com</a>. On the Flex SDK team we use this tool to perform code coverage for the Flex Framework. This tool is not tied to any specific SDK version and so it can be used to perform code coverage using the latest SDK build. Also any SWF compiled with -debug flag can be used to generate code coverage data. You can use it for your Flex Apps or AIR apps or pure AS3 apps. </p>
<p>For documentation related to the tool you can go <a href="http://labs.adobe.com/wiki/index.php/ActionScript_Code_Coverage:Using">here</a></p>
<p>This tool allows for the following:</p>
<ul>
<li>Choose between line and/or method level coverage</li>
<li>Apply filters on the view &#8211; so you can hide packages in which you are not interested</li>
<li>Save detailed reports &#8211; so you can view them later and compare with other coverage reports for your code base</li>
<li>Export high level coverage summary &#8211; This is a csv based summary of coverage for your code base</li>
</ul>
<p>When you save a detailed report, it creates two files on your system .ascc and .ascs. The .ascs file is a compressed file that contains the sources on which the coverage was performed. So if you want another engineers on your team to look at the coverage data, just give them the two files and they won&#8217;t need to sync to the sources on their computer (because the sources for the report will come from .ascs file).</p>
<p>It can even be used to perform code coverage for more than one applications at the same time (may be you have a library or framework for which you have a ton of test cases).</p>
<p>I encourage you to try the tool, and if you have any questions or feedback please use the <a href="http://forums.adobe.com/community/labs/ascode_coverage/">forum</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://gauravj.com/blog/2010/09/code-coverage-tool-for-actionscript/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Creating SWC files with asdoc comments..</title>
		<link>http://gauravj.com/blog/2010/01/creating-swc-files-with-asdoc-comments/</link>
		<comments>http://gauravj.com/blog/2010/01/creating-swc-files-with-asdoc-comments/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 06:36:28 +0000</pubDate>
		<dc:creator>Gaurav</dc:creator>
				<category><![CDATA[Flex Tools]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[ASDoc]]></category>
		<category><![CDATA[examples]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[MXML]]></category>
		<category><![CDATA[SWC]]></category>

		<guid isPermaLink="false">http://gauravj.com/blog/?p=572</guid>
		<description><![CDATA[<p>Have you tried the latest Flash Builder? If not, the latest beta can be downloaded from http://labs.adobe.com/technologies/flashbuilder4/?sdid=EUHSU</p> <p>But if you have already tried it, you would have noticed that now ActionScript and MXML editors show ASDoc documentation when you hover over variables/method/class names. See screen shot below: </p> <p>This means that you can now <span style="color:#777"> . . . &#8594; Read More: <a href="http://gauravj.com/blog/2010/01/creating-swc-files-with-asdoc-comments/">Creating SWC files with asdoc comments..</a></span>]]></description>
			<content:encoded><![CDATA[<p>Have you tried the latest Flash Builder? If not, the latest beta can be downloaded from <a href="http://labs.adobe.com/technologies/flashbuilder4/?sdid=EUHSU">http://labs.adobe.com/technologies/flashbuilder4/?sdid=EUHSU</a></p>
<p>But if you have already tried it, you would have noticed that now ActionScript and MXML editors show ASDoc documentation when you hover over variables/method/class names. See screen shot below:<br />
<img src="http://www.gauravj.com/blog/examples/ASDoc/FlashBuilder_ASDoc_Help.png" /></p>
<p>This means that you can now see the documentation as you are writing code. You can see the method/variable signature or any other documentation associated with any of the class elements. And for all this you don&#8217;t need to open the language reference in a separate browser window or search for the documentation.</p>
<p>Behind the scenes Flash Builder pulls this information from the Flex SDK swc files and the ASDoc info is stored in XML files inside the SWC files. For all nightly builds of Flex SDK, the swcs will come with these ASDoc XML files. In case you want to add similar ASDoc XML files to your custom swcs, you can do that too. Currently there is no single command to generate swc with ASDoc XML files, it is done in three simple steps. And the three steps are:</p>
<ol>
<li>Generate SWC</li>
<li>Generate doc XML Files using ASDoc tool</li>
<li>Update SWC with doc XML fIles</li>
</ol>
<p>I hope you already know how to generate a swc file. If not, take a look at <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_22.html">http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_22.html</a><br />
In order to generate the doc XML files using ASDoc tool, you will have to run the asdoc tool using <strong>-keep-xml=true</strong> and <strong>-skip-xsl=true</strong><br />
A swc file is a compressed file, so to update it (with doc XML files) you can simply use a zip command. </p>
<p>For reference, you can also look at the build.xml file in the framework project of the Flex SDK. Following is the &#8220;doc&#8221; target which performs step #2 and #3:</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;target name=<span style="color: #ff0000;">&quot;doc&quot;</span> depends=<span style="color: #ff0000;">&quot;clean-temp-docs&quot;</span> description=<span style="color: #ff0000;">&quot;updates framework.swc with asdoc xml&quot;</span><span style="color: #7400FF;">&gt;</span></span>
		<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- Load the &lt;asdoc&gt;</span></span> task. We can't do this at the <span style="color: #000000;">&lt;project<span style="color: #7400FF;">&gt;</span></span> level --&gt;
		<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- because targets that run before flexTasks.jar gets built would fail. --&gt;</span></span>
		<span style="color: #000000;">&lt;taskdef resource=<span style="color: #ff0000;">&quot;flexTasks.tasks&quot;</span> classpath=<span style="color: #ff0000;">&quot;${FLEX_HOME}/lib/flexTasks.jar&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
	    <span style="color: #000000;">&lt;condition property=<span style="color: #ff0000;">&quot;asdoc.jvm.args&quot;</span> value=<span style="color: #ff0000;">&quot;-Xmx384m&quot;</span><span style="color: #7400FF;">&gt;</span></span>
	        <span style="color: #000000;">&lt;os family=<span style="color: #ff0000;">&quot;windows&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
	    <span style="color: #000000;">&lt;/condition<span style="color: #7400FF;">&gt;</span></span>
&nbsp;
	    <span style="color: #000000;">&lt;condition property=<span style="color: #ff0000;">&quot;asdoc.jvm.args&quot;</span> value=<span style="color: #ff0000;">&quot;-Xmx512m&quot;</span><span style="color: #7400FF;">&gt;</span></span>
	        <span style="color: #000000;">&lt;os family=<span style="color: #ff0000;">&quot;mac&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
	    <span style="color: #000000;">&lt;/condition<span style="color: #7400FF;">&gt;</span></span>
&nbsp;
	    <span style="color: #000000;">&lt;condition property=<span style="color: #ff0000;">&quot;asdoc.jvm.args&quot;</span> value=<span style="color: #ff0000;">&quot;-Xmx512m&quot;</span><span style="color: #7400FF;">&gt;</span></span>
	        <span style="color: #000000;">&lt;os family=<span style="color: #ff0000;">&quot;unix&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
	    <span style="color: #000000;">&lt;/condition<span style="color: #7400FF;">&gt;</span></span>
&nbsp;
		<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- Call asdoc to generate dita xml files --&gt;</span></span>
		<span style="color: #000000;">&lt;asdoc output=<span style="color: #ff0000;">&quot;${FLEX_HOME}/tempDoc&quot;</span> lenient=<span style="color: #ff0000;">&quot;true&quot;</span> failonerror=<span style="color: #ff0000;">&quot;true&quot;</span> keep-xml=<span style="color: #ff0000;">&quot;true&quot;</span> skip-xsl=<span style="color: #ff0000;">&quot;true&quot;</span> fork=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
		    <span style="color: #000000;">&lt;compiler.source-path path-element=<span style="color: #ff0000;">&quot;${basedir}/src&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		    <span style="color: #000000;">&lt;doc-classes class=<span style="color: #ff0000;">&quot;FrameworkClasses&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		    <span style="color: #000000;">&lt;doc-namespaces uri=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		    <span style="color: #000000;">&lt;namespace uri=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> manifest=<span style="color: #ff0000;">&quot;${basedir}/manifest.xml&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		    <span style="color: #000000;">&lt;jvmarg line=<span style="color: #ff0000;">&quot;${asdoc.jvm.args}&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		<span style="color: #000000;">&lt;/asdoc<span style="color: #7400FF;">&gt;</span></span>
&nbsp;
		<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- updates framework.swc with asdoc xml --&gt;</span></span>
		<span style="color: #000000;">&lt;zip destfile=<span style="color: #ff0000;">&quot;${FLEX_HOME}/frameworks/locale/en_US/framework_rb.swc&quot;</span> update=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
		    <span style="color: #000000;">&lt;zipfileset dir=<span style="color: #ff0000;">&quot;${FLEX_HOME}/tempDoc/tempdita&quot;</span> prefix=<span style="color: #ff0000;">&quot;docs&quot;</span><span style="color: #7400FF;">&gt;</span></span>
			    <span style="color: #000000;">&lt;include name=<span style="color: #ff0000;">&quot;*.*&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
				<span style="color: #000000;">&lt;exclude name=<span style="color: #ff0000;">&quot;ASDoc_Config.xml&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
				<span style="color: #000000;">&lt;exclude name=<span style="color: #ff0000;">&quot;overviews.xml&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		    <span style="color: #000000;">&lt;/zipfileset<span style="color: #7400FF;">&gt;</span></span>
		<span style="color: #000000;">&lt;/zip<span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;">&lt;/target<span style="color: #7400FF;">&gt;</span></span></pre></div></div>

</blockquote>
<p>So give it a try, and if you find any bugs you can log them at <a href="http://bugs.adobe.com/flex">http://bugs.adobe.com/flex</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gauravj.com/blog/2010/01/creating-swc-files-with-asdoc-comments/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Styles, Themes, and the stricter Compiler</title>
		<link>http://gauravj.com/blog/2009/12/styles-themes-and-the-stricter-compiler/</link>
		<comments>http://gauravj.com/blog/2009/12/styles-themes-and-the-stricter-compiler/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 05:38:25 +0000</pubDate>
		<dc:creator>Gaurav</dc:creator>
				<category><![CDATA[Flex Tools]]></category>
		<category><![CDATA[examples]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://gauravj.com/blog/?p=541</guid>
		<description><![CDATA[<p>In Flex 3, the styles defined using the [Style] metadata were validated by the flex compiler, but styles defined in css files were not validated.. </p> <p>Flex 4 has multiple themes:</p> Spark: The default theme for Flex 4. It contains the skins for Spark and MX Components Halo: The default theme for MX components <span style="color:#777"> . . . &#8594; Read More: <a href="http://gauravj.com/blog/2009/12/styles-themes-and-the-stricter-compiler/">Styles, Themes, and the stricter Compiler</a></span>]]></description>
			<content:encoded><![CDATA[<p>In Flex 3, the styles defined using the [Style] metadata were validated by the flex compiler, but styles defined in css files were not validated.. </p>
<p>Flex 4 has multiple themes:</p>
<ol>
<li>Spark: The default theme for Flex 4. It contains the skins for Spark and MX Components</li>
<li>Halo: The default theme for MX components (if you set -compatibility-version=3.0.0)</li>
</ol>
<p>Some style can be valid for only one theme but not the other. So if an app uses such a style(valid for one a specific theme), the style won&#8217;t work if the theme is switched. This could lead to confusion. To help avoid such situation the Flex 4 compiler is stricter than then Flex 3 compiler. </p>
<p>Flex 4 compiler now validates the styles against the theme.</p>
<p>So for example, if you have an app like:</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span> </span>
<span style="color: #000000;">			   xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span> </span>
<span style="color: #000000;">			   xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> label=<span style="color: #ff0000;">&quot;Hello World !!&quot;</span> borderColor=<span style="color: #ff0000;">&quot;#FF0000&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>	
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

</blockquote>
<p>Compiling it with the Flex 4 will generate an error like: Error: The style &#8216;borderColor&#8217; is only supported by type &#8216;mx.controls.Button&#8217; with the theme(s) &#8216;halo&#8217;.</p>
<p>If however, you had specified the &#8220;borderStyle&#8221; using an external css file or the &lt;Style&gt; block , for example:</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span> </span>
<span style="color: #000000;">			   xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span> </span>
<span style="color: #000000;">			   xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
		@namespace mx &quot;library://ns.adobe.com/flex/mx&quot;;
&nbsp;
		mx|Button#buttonId
		{
			borderColor: #FFFF00;
		}
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> label=<span style="color: #ff0000;">&quot;Hello&quot;</span> id=<span style="color: #ff0000;">&quot;buttonId&quot;</span> <span style="color: #7400FF;">/&gt;</span><span style="color: #7400FF;">&lt;mx:Button</span> label=<span style="color: #ff0000;">&quot;World&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>		
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

</blockquote>
<p>Compiling it with the Flex 4  would generate a warning like: Warning: The style &#8216;borderColor&#8217; is only supported by type &#8216;mx.controls.Button&#8217; with the theme(s) &#8216;halo&#8217;.</p>
<p>So the rule is &#8220;error if invalid style specified inline&#8221;, and &#8220;warning if invalid style is specified using css/&lt;Style&gt; block&#8221;</p>
<p>The recommended way of resolving these warnings/errors is to update the code. </p>
<p>But there may be situations where you would want to re-use some of the components written for your flex 3 apps into the flex 4 apps. If for some reason you can not update those components, you can make use of the newly introduced compiler switches (and buy yourself some time) <img src='http://gauravj.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>The new switches are:</p>
<ol>
<li>-report-invalid-styles-as-warnings: this can be used if your app specified styles inline, and those styles are not valid for the current theme. The default value for this is false, and setting it to true will enables reporting of invalid styles as warnings.</li>
<li>show-invalid-css-property-warnings: this can be used if you app specified styles using the css files/&lt;Style&gt; block, and those styles are not valid for the current theme. The default value for this is false, and this switch can be used to toggle whether invalid css property warnings are reported.</li>
</ol>
<p>You can download the latest nightly builds for Flex 4 from <a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gauravj.com/blog/2009/12/styles-themes-and-the-stricter-compiler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

