<?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>Curious Minds Media Labs - &#187; Adobe</title>
	<atom:link href="http://www.curiousm.com/labs/category/adobe/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.curiousm.com/labs</link>
	<description>iOS, Mobile, Design and Technology Tutorials</description>
	<lastBuildDate>Mon, 11 Feb 2013 19:37:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>CSV / XLS Exporting in Adobe Coldfusion 9</title>
		<link>http://www.curiousm.com/labs/2011/08/19/csv-xls-exporting-in-adobe-coldfusion-9/</link>
		<comments>http://www.curiousm.com/labs/2011/08/19/csv-xls-exporting-in-adobe-coldfusion-9/#comments</comments>
		<pubDate>Fri, 19 Aug 2011 15:23:50 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[cfspreadsheet]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[spreadsheet]]></category>
		<guid isPermaLink="false">http://www.curiousm.com/labs/?p=1368</guid>
		<description><![CDATA[Let’s talk about XLS Exporting in Adobe Coldfusion 9 (Excel Spreadsheets). ColdFusion has this neat little tag called cfspreadsheet. It allows the writing of, updating of, and reading of CSV/XLS files in ColdFusion. This is a handy tool for exporting dynamically generated queries. It can make XLS Exporting in Adobe Coldfusion 9 very simple and [...]]]></description>
			<content:encoded><![CDATA[<p>Let’s talk about XLS Exporting in Adobe Coldfusion 9 (Excel Spreadsheets). ColdFusion has this neat little tag called <a href="http://www.curiousm.com//help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec17cba-7f87.html”">cfspreadsheet</a>. It allows the writing of, updating of, and reading of CSV/XLS files in ColdFusion. This is a handy tool for exporting dynamically generated queries. It can make XLS Exporting in Adobe Coldfusion 9 very simple and easy to implement. For example, generating reports and listings of information. Adobe documented the cfspreadsheet tag as such:</p>
<p><strong>Description</strong><br />
1. Manages Excel spreadsheet files<br />
2. Reads a sheet from a spreadsheet file and stores it in a ColdFusion spreadsheet object, query, CSV string, or HTML string.<br />
3. Writes single sheet to a new XLS file from a query, ColdFusion spreadsheet object, or CSV string variable.<br />
4. Add a sheet to an existing XLS file.</p>
<p>The description as outlined above shows that this tag is very useful, and can write XLS files from <a href="http://www.curiousm.com//help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7fae.html”">cfquery</a> objects, csv string variables, or html strings. You can also write a custom ColdFusion function to upload an XLS file, read the content, and input it into a database. However, XLS Exporting in Adobe Coldfusion 9 has its downsides.<span id="more-1368"></span></p>
<p>The problems with using the cfspreadsheet tag arise when your code logic that builds a ColdFusion spreadsheet object becomes lengthy. When manipulating a ColdFusion spreadsheet object, it slows down your code exponentially. This means the more you have to process, the longer it takes to do so. I got to the point where I could pull a 10,000 record cfquery from the database in 3-4 seconds, but it would take me about 4-5 minutes to put together the ColdFusion spreadsheet object and formatting it the way I wanted it.</p>
<p>Below is an example of a lengthy ColdFusion spreadsheet object being put together and exported to an .xls file.</p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfscript&gt;
	theDir=GetDirectoryFromPath(GetCurrentTemplatePath());
   theFile=theDir &amp; &quot;ExampleReport.xls&quot;;
	theSheet = SpreadsheetNew(&quot;testSpreadsheet&quot;);
&lt;/cfscript&gt;
&lt;cfset spacer = &quot;,,&quot;&gt;
&lt;cfset newTitle = &quot;Event / Ticket Type,Quantity&quot;&gt;
&lt;cfset SpreadsheetAddRow(theSheet,newTitle)&gt;
&lt;cfset tempCITY = ''&gt;
&lt;cfset tempTIME = ''&gt;
&lt;cfset totalTicketsArray = ArrayNew(1) /&gt;
&lt;cfloop query=&quot;collection.TICKETTYPES&quot;&gt;
	&lt;cfif #CITYNAME# NEQ tempCITY OR #PERFORMANCETIME# NEQ tempTIME&gt;
		&lt;cfset tempCITY = #CITYNAME#&gt;
		&lt;cfset tempTIME = #PERFORMANCETIME#&gt;
		&lt;cfif currentrow NEQ '1'&gt;
				&lt;cfset arraySum = &quot;Total Tickets: ,#REReplace(numberFormat(arraySum(totalTicketsArray)), &quot;,&quot;, &quot;&quot;, &quot;All&quot;)#&quot; /&gt;
				&lt;cfset SpreadsheetAddRow(theSheet,arraySum)&gt;
				&lt;cfset tmp = ArrayClear(totalTicketsArray)&gt;
 				&lt;/cfif&gt;
 				&lt;cfset SpreadsheetAddRow(theSheet,spacer)&gt;
		&lt;cfset newRowHeader = &quot;#CITYNAME#  ( #timeService.getFormattedDateDSTSimple(PERFORMANCETIME,TIMEZONEOFFSET)# @ #timeService.getFormattedTime(PERFORMANCETIME,TIMEZONEOFFSET)# )&quot;&gt;
		&lt;cfset SpreadsheetAddRow(theSheet,newRowHeader)&gt;
	&lt;/cfif&gt;
	&lt;cfset newTicket = &quot;#REReplace(TICKETNAME, &quot;,&quot;, &quot;&quot;, &quot;All&quot;)#,#TICKETQTY#&quot;&gt;
	&lt;cfset SpreadsheetAddRow(theSheet,newTicket)&gt;
	&lt;cfset arrayAppend(totalTicketsArray, #TICKETQTY#) /&gt;
	&lt;cfif currentrow EQ recordcount&gt;
			&lt;cfset arraySum = &quot;Total Tickets: ,#REReplace(numberFormat(arraySum(totalTicketsArray)), &quot;,&quot;, &quot;&quot;, &quot;All&quot;)#&quot; /&gt;
			&lt;cfset SpreadsheetAddRow(theSheet,arraySum)&gt;
			&lt;cfset tmp = ArrayClear(totalTicketsArray)&gt;
				&lt;/cfif&gt;
&lt;/cfloop&gt;
&lt;cfset SpreadsheetAddRow(theSheet,spacer)&gt;
&lt;cfset newTitle = &quot;Payment Method,Amount&quot;&gt;
&lt;cfset SpreadsheetAddRow(theSheet,newTitle)&gt;
&lt;cfset tempCITY = ''&gt;
&lt;cfset tempTIME = ''&gt;
&lt;cfset tmp = ArrayClear(totalTicketsArray)&gt;
&lt;cfloop query=&quot;collection.CARDTYPES&quot;&gt;
	&lt;cfif #CITYNAME# NEQ tempCITY OR #PERFORMANCETIME# NEQ tempTIME&gt;
		&lt;cfset tempCITY = #CITYNAME#&gt;
		&lt;cfset tempTIME = #PERFORMANCETIME#&gt;
		&lt;cfif currentrow NEQ '1'&gt;
				&lt;cfset arraySum = &quot;Total Tickets: ,#REReplace(dollarFormat(arraySum(totalTicketsArray)), &quot;,&quot;, &quot;&quot;, &quot;All&quot;)#&quot; /&gt;
				&lt;cfset SpreadsheetAddRow(theSheet,arraySum)&gt;
				&lt;cfset tmp = ArrayClear(totalTicketsArray)&gt;
 				&lt;/cfif&gt;
 				&lt;cfset SpreadsheetAddRow(theSheet,spacer)&gt;
		&lt;cfset newRowHeader = &quot;#CITYNAME#  ( #timeService.getFormattedDateDSTSimple(PERFORMANCETIME,TIMEZONEOFFSET)# @ #timeService.getFormattedTime(PERFORMANCETIME,TIMEZONEOFFSET)# )&quot;&gt;
		&lt;cfset SpreadsheetAddRow(theSheet,newRowHeader)&gt;
	&lt;/cfif&gt;
	&lt;cfset newTicket = &quot;#REReplace(CARDTYPE, &quot;,&quot;, &quot;&quot;)#,#REReplace(dollarFormat(TICKETSALES), &quot;,&quot;, &quot;&quot;, &quot;All&quot;)#&quot;&gt;
	&lt;cfset SpreadsheetAddRow(theSheet,newTicket)&gt;
	&lt;cfset arrayAppend(totalTicketsArray, #TICKETSALES#) /&gt;
	&lt;cfif currentrow EQ recordcount&gt;
			&lt;cfset arraySum = &quot;Total Tickets: ,#REReplace(dollarFormat(arraySum(totalTicketsArray)), &quot;,&quot;, &quot;&quot;, &quot;All&quot;)#&quot; /&gt;
			&lt;cfset SpreadsheetAddRow(theSheet,arraySum)&gt;
			&lt;cfset tmp = ArrayClear(totalTicketsArray)&gt;
				&lt;/cfif&gt;
&lt;/cfloop&gt;
&lt;cfspreadsheet
    action=&quot;write&quot;
	format=&quot;csv&quot;
    filename=&quot;#theFile#&quot;
	sheetname=&quot;ExampleReport&quot;
	name=&quot;theSheet&quot;
    overwrite=&quot;true&quot; /&gt;
</pre>
<p>The first part of the code is a <a href="http://www.curiousm.com//help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7ebf.html”">cfscript</a> tag, which puts together the directory and spreadsheet variables that will be used to create the final spreadsheet file. Then follows some complex code logic that iterates through a ColdFusion variable called “collection”. This variable I instantiated previously as a ColdFusion structure that holds two cfquery variables, TICKETTYPES and CARDTYPES. I wanted both these queries to be added to the .xls spreadsheet.</p>
<p>In this complex code, I iterate through portions of each query, ordering them by a specific date value inside each query row. So, for example, my .xls spreadsheet would have headers on the top and for each instance of a specific date, include the TICKETTYPES (and then for the second part of the spreadsheet, the CARDTYPES).</p>
<p>For two queries of 10,000 rows each (one for TICKETTYPES and one for CARDTYPES) this complex code was taking forever to format a ColdFusion spreadsheet object. So I came up with a simple solution. When you format a query inside the SQL to display the way you want it on the spreadsheet, it offloads work from the ColdFusion server and onto the SQL database. In the end, all I had to do was include the below code to turn the generated cfquery into an .xls spreadsheet.</p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfscript&gt;
	theDir=GetDirectoryFromPath(GetCurrentTemplatePath());
    file1=theDir &amp; &quot;ExampleReports.xls&quot;;
&lt;/cfscript&gt;
&lt;cfspreadsheet
    action=&quot;write&quot;
    filename=&quot;#file1#&quot;
	sheetname=&quot;TicketTypes&quot;
	query=&quot;collection.TICKETTYPES&quot;
    overwrite=&quot;true&quot; /&gt;
&lt;cfspreadsheet
    action=&quot;update&quot;
    filename=&quot;#file1#&quot;
	sheetname=&quot;CardTypes&quot;
	query=&quot;collection.CARDTYPES&quot; /&gt;
</pre>
<p>The code for the first cfspreadsheet tag takes the first query and writes an .xls file to display records exactly as shown in the query variable. The second cfspreadsheet tag updates the current .xls file and adds a second spreadsheet onto it (Excel Spreadsheets can have multiple pages, or different spreadsheets in the same .xls file).</p>
<p>This brings the entire processing time down from 4-5 minutes, to 4-5 seconds. That’s a HUGE difference! Sure, I don’t have all the formatting capabilities that ColdFusion allows for me to have. But the point of understanding came when I realized the people using the spreadsheet need everything laid out in simple rows. They didn’t need headers, spacers or data that was spread out in any fashion. They just needed a row-by-row list of raw data. So, this solution worked out perfectly. This makes XLS Exporting in Adobe Coldfusion 9 very easy to use.</p>
<p>Always remember, when programming using a combined group of different languages (i.e. &#8211; Adobe ColdFusion 9 with an MS SQL Database) you can always offload work from one to the other, depending on the application. Here, we took a 4-5 minute process in ColdFusion and gave that job to the database, which helped it run in less than 4-5 seconds. Using this methodology, you can program less and achieve more, and produce efficient applications and web sites!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.curiousm.com/labs/2011/08/19/csv-xls-exporting-in-adobe-coldfusion-9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NetConnection: Flash Remoting in smaller AS3 projects</title>
		<link>http://www.curiousm.com/labs/2011/07/08/netconnection-flash-remoting-in-smaller-as3-projects/</link>
		<comments>http://www.curiousm.com/labs/2011/07/08/netconnection-flash-remoting-in-smaller-as3-projects/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 17:03:16 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[desktop application]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[AIR Application]]></category>
		<category><![CDATA[Desktop Application]]></category>
		<category><![CDATA[Flash Remoting]]></category>
		<category><![CDATA[Remote Services]]></category>
		<category><![CDATA[var]]></category>
		<guid isPermaLink="false">http://www.curiousm.com/labs/?p=1339</guid>
		<description><![CDATA[What is NetConnection? Located in the flash.net package, NetConnection inherits from EventDispatcher and then Object. It is a simple way to open a connection to a remote server, call services from it and then implement the return values into your ActionScript 3.0 project. This works even in standalone Adobe Air applications. Although it is not [...]]]></description>
			<content:encoded><![CDATA[<p>What is <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/NetConnection.html" target="_blank">NetConnection</a>? Located in the flash.net package, NetConnection inherits from EventDispatcher and then Object. It is a simple way to open a connection to a remote server, call services from it and then implement the return values into your ActionScript 3.0 project. This works even in standalone Adobe Air applications. Although it is not the best option for larger projects, it is a simple way to call remote services from a server without having to set up Value Objects, let alone a complex system. <span id="more-1339"></span> Quoting directly from the Adobe site:</p>
<blockquote><p><em>&#8220;The NetConnection class creates a bidirectional connection between a Flash Player or AIR application and a Flash Media Server application or between a Flash Player or AIR application and an application server running Flash Remoting. A NetConnection object is like a pipe between the client and the server. Use NetStream objects to send streams through the pipe.<br />
Without Flash Media Server, you can use the NetConnection class to play video and MP3 files from a local file system or from a web server.&#8221;</em></p></blockquote>
<p>As you can see, NetConnection already opens up an array of possibilities. In this specific case scenario, let me first start off by saying that I was implementing the <a href="http://www.actionscript.org/resources/articles/679/1/MVC-Design-Pattern/Page1.html" target="_blank">MVC design pattern</a> (Model View Controller). I was building a small Adobe Air Application using the Flex 4 SDK, and heavily relying on ActionScript 3.0 for most of the coding. My objective was to call remote services on three different remote servers, which would return values stating that &#8220;Yes, this server is online.&#8221; Then using the variables that it returned, set up a custom event that would fire off stating whether or not the specific server was online. My Controller would listen for the event, and upon receiving it call the respective function that would change my view to say &#8220;Let&#8217;s turn on the green button instead of the red button, because this server is online!&#8221; Here is the code to set up a connection for a specific server:</p>
<div id="attachment_1356" class="wp-caption alignnone" style="width: 864px"><a href="http://www.curiousm.com/labs/files/2011/07/example.png"><img src="http://www.curiousm.com/labs/files/2011/07/example.png" alt="NetConnection Example" width="854" height="723" class="size-full wp-image-1356" /></a><p class="wp-caption-text">NetConnection Example</p></div>
<p><strong>Step 1: Import related classes</strong><br />
You&#8217;re going to want to import flash.net packages; NetConnection, ObjectEncoding, and Responder.</p>
<p><strong>Step 2: Implement variables and Constructor</strong><br />
Implement whatever public class variables you want, and then pass in an null IEventDispatcher object in the constructor function and call the super of that class. This is only to prevent any issues with dispatching events from this ConnectionController class.</p>
<p><strong>Step 3: Create a function to check a server</strong><br />
Make sure the return type of this function is void. Inside this, create a private variable by declaring the var keyword, for an instance of NetConnection, and any other variables having to do with this one specific function. Declare the ObjectEncoding variable, and the connect variable in the new NetConnection variable you just declared.</p>
<p><strong>Step 4: Call a function and set up dispatchers</strong><br />
Use _gateway.call(locationOfFunctionOnRemoteServer, new Responder(functionIfReturnValue, functionIfError), &#8230;.arguments); to make a call to the server, you can implement this line for however many functions you want to call in this one operation. After this, set up the nested functions that are called in the _gateway.call method, and fire off dispatchers with the related custom event based on a return from the server.</p>
<p>And there you have it, a simple way to call and get a return value from a remote server in AS3.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.curiousm.com/labs/2011/07/08/netconnection-flash-remoting-in-smaller-as3-projects/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Creating ASDocs with ANT &amp; Flash Builder Part 3. Customizing the Documentation Template.</title>
		<link>http://www.curiousm.com/labs/2011/06/27/creating-asdocs-with-ant-flash-builder-part-3-customizing-the-documentation-template/</link>
		<comments>http://www.curiousm.com/labs/2011/06/27/creating-asdocs-with-ant-flash-builder-part-3-customizing-the-documentation-template/#comments</comments>
		<pubDate>Mon, 27 Jun 2011 13:51:59 +0000</pubDate>
		<dc:creator>Momchilova Ralica</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[ANT]]></category>
		<category><![CDATA[ant build file]]></category>
		<category><![CDATA[ant tasks]]></category>
		<category><![CDATA[ant tools]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[asdoc]]></category>
		<category><![CDATA[build file]]></category>
		<category><![CDATA[buildfile.xml]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[generate documentation]]></category>
		<category><![CDATA[project documentation]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">http://www.curiousm.com/labs/?p=1145</guid>
		<description><![CDATA[3. Customizing the HTML template for your Flash Builder Project. There’s no point doing good work if others don’t know about it or can’t understand what you did. When it comes to developing lengthy applications a well written documentation is a must. A well written documentation which compliments your project&#8217;s design shows commitment to the project [...]]]></description>
			<content:encoded><![CDATA[<h3>3. Customizing the HTML template for your Flash Builder Project.</h3>
<p>There’s no point doing good work if others don’t know about it or can’t understand what you did. When it comes to developing lengthy applications a well written documentation is a must. A well written documentation which compliments your project&#8217;s design shows commitment to the project and a professional feel.</p>
<p>In <strong><a href="http://www.curiousm.com/labs/2011/04/18/creating-asdocs-with-ant-flash-builder-part-1/">Part 1</a></strong> of this tutorial we covered ANT installation. <strong><a href="http://www.curiousm.com/labs/2011/04/26/creating-asdocs-with-ant-flash-builder-part-2/">Part 2</a> </strong>explains the best practices for writing comments inside your project&#8217;s classes which later are read by ANT and included in the project documentation. <strong>Part 3</strong> is the final part of this series. It will help you understand how your documentation is structured, and what can be done to customize the HTML template used by ANT to generate the documentation.<br />
The default documentation template is the same as the one used by Adobe to document the ActionScript 3.0 language. Here is a link which I am sure you have visited before:</p>
<h5><strong><a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/class-summary.html#top">http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/class-summary.html#top</a></strong></h5>
<p><strong>Good to know:</strong></p>
<p><strong>What are HTML templates?</strong> An HTML template is a ready-made design of the HTML page. The HTML template usually include most of the source files necessary for further customizing the template. It can be edited using WYSIWYG editors such as Frontpage, Dreamweaver etc.</p>
<p><strong>CSS</strong> - <strong>Cascading Style Sheets </strong>is a language used to create stylesheets in which you can describe presentation semantics, its used mainly with HTML and XHTML pages. It can also be used with Adobe Flash Builder and other. It&#8217;s a good practice to separate the styling of your project in a CSS file. This way the designer and the developer for example can work together and have a smooth workflow.</p>
<p><strong>Where is the template used by ANT ?</strong></p>
<p>The path to the template should look like this:<br />
<span style="color: #ff6600"> /Applications/Adobe Flash Builder 4.5/sdks/4.5.0/asdoc/templates/</span>.</p>
<p><a href="http://www.curiousm.com/labs/files/2011/06/Screen-shot-2011-06-27-at-5.41.49-AM.png"><img class="alignnone size-full wp-image-1258" src="http://www.curiousm.com/labs/files/2011/06/Screen-shot-2011-06-27-at-5.41.49-AM.png" alt="" width="580" height="157" /></a></p>
<p>Inside the &#8220;templates&#8221; folder you will find all the components that make the HTML template. You cannot modify the template directly, but you can create a copy and assign it&#8217;s path in the ANT build script instead of using the default.</p>
<p><strong>The CSS:</strong></p>
<p><strong> </strong><a href="http://www.curiousm.com/labs/files/2011/06/Screen-shot-2011-06-27-at-8.34.25-AM-e1309178339482.png"><img class="alignleft size-full wp-image-1266" src="http://www.curiousm.com/labs/files/2011/06/Screen-shot-2011-06-27-at-8.34.25-AM-e1309178339482.png" alt="" width="326" height="174" /></a>Through this CSS file you can assign styles to all the components that make your documentation pages. You can easily make changes to the documentation pages by modifying the styles.css (path: /Applications/Adobe Flash Builder 4.5/sdks/4.5.0/asdoc/templates/style.css).</p>
<p>In order to modify an element&#8217;s style you need to begin your declaration with the element&#8217;s class name. From then it&#8217;s simple. Assign the new properties as shown on the image above.</p>
<p>You can see the class names of the elements you would like to modify by opening the .html files of the template. Here is an example that shows where and how the class is defined for the elements and also how the stylesheet is assigned to the HTML page. If you have found a CSS stylesheet that fits your needs you could even save time and assign it instead of the default one. Then just make sure to change the class names for the elements that require customization. The global settings would stay the same.</p>
<h3><a href="http://www.curiousm.com/labs/files/2011/06/Screen-shot-2011-06-27-at-8.34.25-AM-e1309178339482.png"></a><a href="http://www.curiousm.com/labs/files/2011/06/Screen-shot-2011-06-27-at-8.44.41-AM.png"><img src="http://www.curiousm.com/labs/files/2011/06/Screen-shot-2011-06-27-at-8.44.41-AM.png" alt="" width="546" height="159" /></a></h3>
<p><strong>Manipulating the HTML itself:</strong></p>
<p>You could manipulate the HTML directly and change the layout of your page as well. I would recommend using Dreamweaver or other free editing software both for the CSS and the HTML. This would help you edit quickly and to see the results immediately as Dreamweaver for example has views that allow you to see the modifications live as you are making them.</p>
<p><a href="http://www.curiousm.com/labs/files/2011/06/Screen-shot-2011-06-27-at-9.10.58-AM.png"><img class="aligncenter size-full wp-image-1282" src="http://www.curiousm.com/labs/files/2011/06/Screen-shot-2011-06-27-at-9.10.58-AM.png" alt="" width="544" height="315" /></a></p>
<p><strong>Finishing up:</strong></p>
<p>The range of modifications you can make to your template has almost no limits. All you need is a basic understanding of the HTML and CSS language and a good editor software.</p>
<p>Once you are ready to use the template or test it you need to assign it inside your build.xml file. (explained in Part 2) Here&#8217;s the example syntax:</p>
<pre class="brush: plain; title: ; notranslate">&lt;arg line=&quot;-templates-path '/Applications/Adobe Flash Builder 4/sdks/4.1.0/asdoc/YourTemplateName'&quot;/&gt;</pre>
<p><a href="http://www.curiousm.com/labs/files/2011/06/Screen-shot-2011-06-27-at-9.30.02-AM.png"><img class="aligncenter size-full wp-image-1288" src="http://www.curiousm.com/labs/files/2011/06/Screen-shot-2011-06-27-at-9.30.02-AM.png" alt="" width="565" height="56" /></a></p>
<p>Above is a snippet of one of CuriousMinds&#8217; project documentation build.xml files.  As you can see there are settings editable directly through the build.xml file like the window-title and other. One of my favorite things to do is to make sure the company branding is displayed as well as the client&#8217;s. An ideal place for the Author&#8217;s name and the Company branding is the footer (line 66).</p>
<p>This is all there is to customizing you template. If you have any questions post and I will try to be quick to answer.</p>
<p>Happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.curiousm.com/labs/2011/06/27/creating-asdocs-with-ant-flash-builder-part-3-customizing-the-documentation-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex and Spring: Communication over BlazeDS &#8211; Part I</title>
		<link>http://www.curiousm.com/labs/2011/06/13/flex-and-spring-communication-over-blazeds-part-i/</link>
		<comments>http://www.curiousm.com/labs/2011/06/13/flex-and-spring-communication-over-blazeds-part-i/#comments</comments>
		<pubDate>Mon, 13 Jun 2011 15:04:28 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[BlazeDS]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Spring]]></category>
		<guid isPermaLink="false">http://www.curiousm.com/labs/?p=1181</guid>
		<description><![CDATA[Leveraging a Spring backend in your Flex application can be a great way to gain access to powerful java tools and server technologies, but getting your client and server all wired up can be pretty challenging, especially for the newcomer. I recently had the opportunity to explore this Pandora&#8217;s box, and came up with a [...]]]></description>
			<content:encoded><![CDATA[<p>Leveraging a Spring backend in your Flex application can be a great way to gain access to powerful java tools and server technologies, but getting your client and server all wired up can be pretty challenging, especially for the newcomer. I recently had the opportunity to explore this Pandora&#8217;s box, and came up with a Flex-Java solution that may work for you, depending on your project&#8217;s needs. In this series of tutorials I want to share with you the way in which I went about getting my application up and running in hopes that other newbies out there might have some success integrating these technologies.</p>
<p><span id="more-1181"></span></p>
<p>NOTE: Please download attached source files from <a href="http://clients.curiousm.com/flex_and_spring/example.zip">here</a> to help you with this tutorial.</p>
<p>I wanted to make use of the Spring framework in my Java backend because of its flexibility and streamlined development. I wanted Hibernate integration also for data persistence to a MySQL database, which I knew Spring could provide me. It seemed to me that this stack would be the perfect combination of tools to get my application off the ground, but I wasn&#8217;t quite sure how to go about putting all these pieces together.</p>
<p>A little research on this topic revealed some solutions like Spring Roo with the Flex scaffolding extensions which, at least at first, seemed would glue all these components together with ease. I&#8217;m sure the Spring Roo project, once it matures a little and stabilizes, will be a viable way to generate the Java classes and Flex remoting scaffold necessary to build an application. That being said, the amount of difficulty I had in getting Spring Roo and Flex to work together was immense. I also have a huge aversion to using new tools to generate code for me that are not yet widely embraced or supported by the community at large, and which I don&#8217;t fully understand inside and out. When eventually the excrement hits the air circulation device, I want to know exactly where a system is failing and why, even if it means spending a few extra hours writing boilerplate code from scratch. I do, however, appreciate the work that Jeremy Grelle et al. have done on this project, but at present, the Roo-Flex project isn&#8217;t stable enough for my tastes. Upon realizing this, I decided to roll up my sleeves and tie the pieces together myself.</p>
<p><strong>Setting up BlazeDS and Tomcat</strong></p>
<p>BlazeDS is a great way to get Flex and java talking to one another. It is free, which lowers the cost barrier for you and your client, and is relatively easy to install. A popular method of getting up and running quickly is to install the BlazeDS turnkey server. This is ostensibly a Tomcat server, bundled with a bunch of very typical examples of how BlazeDS can be utilized. You can download this package from the <a href="http://opensource.adobe.com/wiki/display/blazeds/BlazeDS">Adobe Labs Website</a>, or if you already have a Tomcat installation you want to develop against, you may grab the WAR file and deploy it yourself. Instructions for deploying BlazeDS, starting the server and running the examples can all be found on the website, and in the enclosed documentation.</p>
<p><strong>Maven Management</strong></p>
<p>Once you have a Tomcat installation and BlazeDS running in the container, we can start thinking about how to structure our java project and how to incorporate the Spring and Hibernate libraries into our project. I found SpringSource Tool Suite (STS) to be a useful IDE to develop the java side of my application. It is another Eclipse spinoff, so those familiar with this IDE will feel right at home in these environs. If you use Maven to manage your project dependencies, you can get almost everything you need by adding the requisite nodes to your pom.xml file, or by using the M2Eclipse pom editor to search for and manage your project jars. You can find instructions on installing M2Eclipse for STS on the <a href="http://m2eclipse.sonatype.org/"></a>M2Eclipse project website, and you can get SpringSource Tool Suite from <a href="http://www.springsource.com/developer/sts">here</a>.</p>
<p>Once we have these pieces in place, let&#8217;s start by making a new project in STS. Choose &#8216;New Java Project&#8217; from &#8216;File&#8217; in the main menu of the application, and give it a name. This is the most basic java project configuration, to which we are going to add Maven support, as well as some project facets to get the resources and structure of our project tightened up. The next thing we want to do is enable dependency management with Maven. We&#8217;ll do that by right clicking on the project in our package explorer, and choosing &#8216;Maven -&gt; Enable Dependency Management&#8217;. Here we are presented with some options. Because we are just creating a simple tutorial application here, I&#8217;m leaving my Group Id and Artifact Id alone, and providing a simple name and description for the heck of it. When finished with this step, a pom.xml file will be created in the project folder which we can edit to add dependencies automatically to the build path.</p>
<p><strong>Project Facets</strong></p>
<p>The way Eclipse organizes a project and structures a project to make it runnable in different environments is to add &#8216;facets&#8217; to the project. We are going to add facets to this project now to transform this &#8216;vanilla&#8217; java project into web application deployable to our Tomcat server. Again, right click on the project folder in the Package Explorer and choose &#8216;Properties&#8217;. You&#8217;ll see a menu item in the list called &#8216;Project Facets&#8217;. Choose that, and click the link to &#8216;Convert to faceted form…&#8217;. From the list that appears in the Project Facets Pane, select the &#8216;Dynamic Web Module&#8217; checkbox, leave the &#8216;Java&#8217; checkbox selected and click &#8216;OK&#8217;.</p>
<p>If you were paying attention you&#8217;ll notice that Eclipse just created a folder called &#8216;WebContent&#8217;, and  &#8216;META-INF&#8217; and &#8216;WEB-INF&#8217; folders inside that folder. This is the basic structure our java web application will take on when we export and deploy it.</p>
<p><strong>Spring Dependencies</strong></p>
<p>The Maven dependencies found in the attached project&#8217;s pom.xml file will give you the libraries we&#8217;re going to make use of in the next step of our tutorial. Note that there may be updates to some of these release jars by now, but avoiding the confusion of dependency compatibility is one of my goals in writing this post. Try using this list of dependencies before looking for newer releases, and save yourself some aggravation.</p>
<p>Feel free to copy this list directly into your project&#8217;s pom. Once we have done this, we are ready to begin building our java application&#8217;s context. You should also see that in the package explorer, our folder containing Maven Dependencies has 17 new jar files in it. These are, of course, the dependencies we&#8217;ve just added to our pom.xml.</p>
<p><strong>Spring Flex Integration Jars</strong></p>
<p>In addition to the above resources, we&#8217;re going to need the Flex Spring integration jars. You can get them from the following <a href="http://www.springsource.org/spring-flex">address</a>.</p>
<p>Once you&#8217;ve downloaded these jars, you&#8217;ll want to make sure they get deployed along with your maven managed jars. I made a folder inside my project called &#8216;jar&#8217; into which I&#8217;ve placed additional dependencies. I&#8217;ve included my jars folder here in the project archive, so you can unzip that folder into your project directory and use them. There are a few other jars in this folder. Do yourself a favor and use my jars because there are some dependencies that we have not discussed, which I spent too many hours starting and restarting my server, getting ClassDefinitionNotFound errors, and searching the web for the correct jars containing the right Classes to get this project running. Please trust me on this one. To get the items in the &#8216;jars&#8217; folder to deploy properly, you want to make sure there is a corresponding entry in your &#8216;Web Deployment Assembly&#8217; properties for this project. Go into the Properties for this project and select Deployment Assembly. This is where we can define mappings for deployment of our resources. If it isn&#8217;t done already, map your jar folder to &#8216;/WEB-INF/lib&#8217;. Our jars will now be in place when we deploy our web application.</p>
<p><strong>Part I Wrap Up</strong></p>
<p>Because this process of building all the components that make up this application is quite involved, I am breaking this into smaller, less daunting steps. We now have an STS project with all of the foundation to start coding our backend, and after that, to call our services from a Flex client. Be sure to check back soon for the second part of this tutorial, when we get into some of the more fun aspects of building this project.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.curiousm.com/labs/2011/06/13/flex-and-spring-communication-over-blazeds-part-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AS3 Components for IOS, IPad and IPhone. Or what to do while waiting for Adobe to update FlashBuilder</title>
		<link>http://www.curiousm.com/labs/2011/06/02/as3-components-for-ios-ipad-and-iphone-or-what-to-do-while-waiting-for-adobe-to-update-flashbuilder/</link>
		<comments>http://www.curiousm.com/labs/2011/06/02/as3-components-for-ios-ipad-and-iphone-or-what-to-do-while-waiting-for-adobe-to-update-flashbuilder/#comments</comments>
		<pubDate>Thu, 02 Jun 2011 19:45:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[IPad]]></category>
		<category><![CDATA[Iphone]]></category>
		<category><![CDATA[user interface design]]></category>
		<guid isPermaLink="false">http://www.curiousm.com/labs/?p=1171</guid>
		<description><![CDATA[We&#8217;ve been playing with FlashBuilder 4.5 over here for the past few weeks, and we are pretty impressed. However one major setback remains: There are no mobile components for available for iOS devices. In the current 4.5 build, with AIR 2.6 an iOs project can only be a pure AS3 project no mxml or spark [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been playing with FlashBuilder 4.5 over here for the past few weeks, and we are pretty impressed. However one major setback remains: There are no mobile components for available for iOS devices. In the current 4.5 build, with AIR 2.6 an iOs project can only be a pure AS3 project no mxml or spark classes are allowed. This presents some real problems for developer who are used to having the prebuilt interactivity available. Luckily, there are some libraries out there that may help. Unfortunately none of them are idea. Read on to see what we have come up with.</p>
<p><span id="more-1171"></span>Option #1. Import the .fl classes into Flash Builder.</p>
<p>This probably the easiest way to get some components on the screen, and the only way that I have gotten controls to work properly.  Go into Flash and create a new AS3 project. Drag the components that you need onto the stage, and export as a .swc . Import this .swc into the classpath of your FlashBuilder project and you will have access to scrollbar, button, list and slider .fl classes.</p>
<p>Option #2. <a href="http://mromecki.fr/en/#/post?url=using-flex-3-component-without-mxml-only-as3" target="_blank">Try to bootstap mxm</a>l (not a real great idea.)<br />
The other option, for example, if you would like to use the super cool <a title="FlexPad Lib" href="http://code.google.com/p/flexpad/" target="_blank">FlexPadLib. </a> This is extremely difficult to get right, but you can find some resources on it here.</p>
<p>Option #2a. Hack Flex Mobile Project to compile to Ipad. This is probably your best option. The walkthrough can be found <a href="http://va.lent.in/blog/2011/03/25/air2-6-app-for-ios/#comment-1050" target="_blank">here</a>.</p>
<p>Option #3 try using Iphone styled components for As3. I don&#8217;t know the status of the project, but you can check it out <a href="http://code.google.com/p/as3iphonecomponents/" target="_blank">here</a>.</p>
<p>Option #3a use a very minimal comp set such as <a href="http://www.minimalcomps.com/">MinimalComps</a>, or <a href="http://reflexplatform.com/">Reflex</a></p>
<p>Option #4. Wait for Adobe to update Air for iOs Devices. Along with using the Flex Mobile components, we would also like to see some other nice to haves like native alert window, and background alerts.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.curiousm.com/labs/2011/06/02/as3-components-for-ios-ipad-and-iphone-or-what-to-do-while-waiting-for-adobe-to-update-flashbuilder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating ASDocs with ANT &amp; Flash Builder Part 2. Writing AsDoc Comments.</title>
		<link>http://www.curiousm.com/labs/2011/04/26/creating-asdocs-with-ant-flash-builder-part-2/</link>
		<comments>http://www.curiousm.com/labs/2011/04/26/creating-asdocs-with-ant-flash-builder-part-2/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 13:39:07 +0000</pubDate>
		<dc:creator>Momchilova Ralica</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[ANT]]></category>
		<category><![CDATA[ant build file]]></category>
		<category><![CDATA[ant tasks]]></category>
		<category><![CDATA[ant tools]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[asdoc]]></category>
		<category><![CDATA[build file]]></category>
		<category><![CDATA[buildfile.xml]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[generate documentation]]></category>
		<category><![CDATA[project documentation]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">http://www.curiousm.com/labs/?p=897</guid>
		<description><![CDATA[2. Project Documentation Process for Ant on standalone Flash Fuilder 4.5. Common Glossary and Output. This tutorial covers the documentation process for Ant on Adobe® Flash Builder 4.5. You will be presented with the most common ASDoc comments, their purpose and output in the generated documentation, and examples of documentation page templates and their customization [...]]]></description>
			<content:encoded><![CDATA[<h3><span style="font-size: 20px"><strong>2. Project Documentation Process for Ant on standalone Flash Fuilder 4.5. Common Glossary and Output.</strong></span></h3>
<p>This tutorial covers the documentation process for Ant on Adobe® Flash Builder 4.5. You will be presented with the most common ASDoc comments, their purpose and output in the generated documentation, and examples of documentation page templates and their customization process.</p>
<p>This is <em>Part 2</em> of the Ant and Flash Builder 4.5 tutorial. If you have not yet installed and setup Ant on the standalone version of Flash Builder you can refer to <strong><a href="http://www.curiousm.com/labs/2011/04/18/creating-asdocs-with-ant-flash-builder-part-1/" target="_blank">Part 1</a></strong>. There you can get a step-by-step instruction on how to install and setup Ant.</p>
<p>Once you have installed and properly setup Ant on Flash Builder, it&#8217;s time to write some ASDoc comments in ActionScript® . When you generate the documentation later this code will be recognized by the Ant documentation tool and included in the generated project documentation. If you are thorough in your comments and update them along with the project&#8217;s development process, you will end up with one well written and detailed documentation and you will never forget what each class is used for.</p>
<h2>Good to know:</h2>
<h2><span style="font-size: 13px;font-weight: normal">•  Adobe&#8217;s help documentation is very detailed and shows all the best practices regarding the documentation process. It contains AsDoc comment examples and their formatting for all types of ActionScript classes.You can visit their documentation <span style="font-size: 15px;font-weight: bold"><a href="http://help.adobe.com/en_US/flex/using/WSd0ded3821e0d52fe1e63e3d11c2f44bb7b-7fed.html">here</a></span>.</span></h2>
<p>This post is an addition which will help you instantly see what the result of the most common AsDoc comments looks like in the generated documentation. I will also cover a few mistakes that are common and if not minded can slow down your workflow or be the cause for errors which can go unnoticed by the documentation tool.</p>
<p>•  There is a list of HTML tags you can use to format you AsDoc comments. Bear in mind that this list of tags is limited, and that while in some sections of an AsDoc comment you can use them, in other places they are not accepted and can produce an error.<br />
A summary of these HTML elements can be found <a href="http://help.adobe.com/en_US/flex/using/WSd0ded3821e0d52fe1e63e3d11c2f44bc36-8000.html"><strong><span style="font-size: medium">here</span></strong></a></p>
<p>•  There are two types of AsDoc comments: ActionScript comments and MXML comments.</p>
<h2>Examples:</h2>
<p><strong>ActionScript</strong> comments are declared to start with  /**  character sequence and the end is declared by */. Read the example below:</p>
<pre class="brush: as3; title: ; notranslate"> /**
*  The first sentence would be used to describe
*  the class. Next sentences only show in the
*  class' detail view.
*/
</pre>
<p><em><span style="font-size: small">An example of an AsDoc comment used to describe a class.</span></em><br />
<span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size: 13px;line-height: 19px"><em>output:</em></span></p>
<p><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size: 13px;line-height: 19px"><em><a href="http://www.curiousm.com/labs/files/2011/04/ClassDescr.png"><img class="alignnone size-full wp-image-1002" src="http://www.curiousm.com/labs/files/2011/04/ClassDescr.png" alt="" width="570" height="173" /></a></em></span><br />
<em><span style="font-size: small">Above is a list of classes and their short descriptions generated by the documentation tool. The short description on the right is the first sentence in your AsDoc comment for that class.</span></em></p>
<p>Below is a view of the same class&#8217; Detail Page.</p>
<p><a href="http://www.curiousm.com/labs/files/2011/04/classDetailView.png"><img class="size-full wp-image-1007 alignnone" src="http://www.curiousm.com/labs/files/2011/04/classDetailView.png" alt="" width="570" height="138" /></a></p>
<p>• Commenting Functions:</p>
<pre class="brush: as3; title: ; notranslate">/**
* AsDoc comment for the &lt;code&gt;onViewClick&lt;/code&gt;
* method.  HTML tags &lt;strong&gt;can&lt;/strong&gt; be used
* here.
* @param evt Parameter tags are
* descriptions of the parameters this
* method can take in.
*/
override protected function onViewClick(evt:MouseEvent):void{
switch(evt.currentTarget){</pre>
<p><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size: 13px;line-height: 19px"><em>output:</em></span><br />
<span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size: 13px;line-height: 19px"><em><a href="http://www.curiousm.com/labs/files/2011/04/ClassComment1.png"><img class="alignnone size-full wp-image-1077" src="http://www.curiousm.com/labs/files/2011/04/ClassComment1.png" alt="" width="570" height="178" /></a></em></span><br />
<em><span style="font-size: small">Above is a snapshot of a Class Detail View page generated by the documentation tool.</span></em></p>
<p><strong>MXML</strong> AsDoc comments:</p>
<pre class="brush: plain; title: ; notranslate">Comments start with the &lt;!--- characters and
end with  --&gt; character.</pre>
<p>This comment is placed after the xml ecoding declaration and does not require a CDATA block. You can use the same comment structure when you are commenting MXML components such as buttons, DataGrids, etc.</p>
<p>Here is an example of invalid implementation of the &lt;h1&gt;<strong>Header 1</strong>&lt;/h1&gt; tag used where it does not belong. The text encapsulated in the wrong tag is simply omitted in the output. If these errors are not corrected you would end up with unreadable documentation.<br />
<img src="http://www.curiousm.com/labs/files/2011/04/AsDocComment1.png" alt="" width="572" height="75" /></p>
<p><em><span style="font-size: small">This is an MXML AsDoc comment.</span></em><br />
<span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size: 13px;line-height: 19px"><em>output:</em></span><br />
<a href="http://www.curiousm.com/labs/files/2011/04/AsDocCommentOutput1.png"><img src="http://www.curiousm.com/labs/files/2011/04/AsDocCommentOutput1.png" alt="" width="570" height="68" /></a><br />
<em><span style="font-size: small">Above is a snapshot of a Class Detail View page generated by the documentation tool.</span></em></p>
<h2>Errors</h2>
<p>My advice is when you start a new project always setup your documentation along with the project. There is nothing worse than an already built project that you have to create documentation for. When you are put in a situation where you have to document an already created project prepare to be patient and expect errors.<br />
Here are a few common things that would cause a Build fail:</p>
<p>• Improperly imported classes or classes that have not been imported at all. Even though Flash Builder will run your project, and build successfully, the documentation tools will fail at that obstacle.</p>
<p>• Undeclared in the build file external resources and related projects. If you have read <strong><a href="http://www.curiousm.com/labs/2011/04/18/creating-asdocs-with-ant-flash-builder-part-1/" target="_blank">Part 1</a></strong> of this tutorial,  you must now know about the &#8220;-source-path&#8221;, &#8220;-doc-sources&#8221;, &#8220;-external-library-path&#8221;, and my personal favorite &#8220;-exclude-classes&#8221;. Declare all external resources because they are mentioned in your project&#8217;s code and the documentation tool would look for them, but will not find them unless you specify their paths in your buildFile.xml.</p>
<p><a href="http://www.curiousm.com/labs/files/2011/04/externalPaths.png"><img class="alignnone size-full wp-image-1165" src="http://www.curiousm.com/labs/files/2011/04/thumbOfExtPaths.png" alt="" width="556" height="118" /></a></p>
<p>• Be careful where you place your build-file. You cannot modify the example build-file you will find in the Ant folder, but you can copy and customize it. I place my build-files directly in this location: /Applications/Adobe Flash Builder 4/sdks/4.1.0/ant/yourBuildFile.xml.</p>
<p>• Spark and Halo do not always mix when it comes to documentation. Below is an example of what happens when you have halo for a project theme but you have used a spark component. <a href="http://www.curiousm.com/labs/files/2011/04/Screen-shot-2011-04-21-at-3.03.47-PM.png"><img class="alignnone size-full wp-image-932" src="http://www.curiousm.com/labs/files/2011/04/Screen-shot-2011-04-21-at-3.03.47-PM-e1303478387986.png" alt="" width="570" height="63" /></a><br />
<em><span style="font-size: small">Ant build Error.</span></em></p>
<p>I will keep adding to this list every time I meet a new issue regarding documentation generation.</p>
<p>Next is <strong>Part 3</strong> of this tutorial, where I will cover template customization. This way your documentation can take on a view and feel closer to that of your project, and I promise you good presentation always pays!</p>
<p>Happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.curiousm.com/labs/2011/04/26/creating-asdocs-with-ant-flash-builder-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe Announces Creative Suite 5.5</title>
		<link>http://www.curiousm.com/labs/2011/04/11/adobe-creative-suite-5-5-announced/</link>
		<comments>http://www.curiousm.com/labs/2011/04/11/adobe-creative-suite-5-5-announced/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 14:54:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<guid isPermaLink="false">http://www.curiousm.com/labs/?p=662</guid>
		<description><![CDATA[Adobe announced creative suite 5.5 today. Of interest to us is the support for RIM devices in the new version of Flash Builder. Also, the Flex 4.5 framework will include mobile support. We are very excited about the increased frequency of Adobe&#8217;s product release cycle, and we are really looking forward to getting to play [...]]]></description>
			<content:encoded><![CDATA[<p>Adobe announced creative suite 5.5 today. Of interest to us is the support for RIM devices in the new version of Flash Builder. Also, the Flex 4.5 framework will include mobile support. We are very excited about the increased frequency of Adobe&#8217;s product release cycle, and we are really looking forward to getting to play with some new toys!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.curiousm.com/labs/2011/04/11/adobe-creative-suite-5-5-announced/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Connect to LinkedIn API from AS3 and Adobe AIR</title>
		<link>http://www.curiousm.com/labs/2011/03/09/connect-to-linked-in-api-from-as3-and-adobe-air/</link>
		<comments>http://www.curiousm.com/labs/2011/03/09/connect-to-linked-in-api-from-as3-and-adobe-air/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 16:42:04 +0000</pubDate>
		<dc:creator>cmmlabs</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[desktop application]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flex]]></category>
		<guid isPermaLink="false">http://curiousmindsmedia.wordpress.com/?p=586</guid>
		<description><![CDATA[For the purposes of this post however, I’d like to focus on LinkedIn’s API. Connecting to this service represents the other end of the difficulty spectrum in my opinion, and required quite a lot of tinkering to implement successfully.]]></description>
			<content:encoded><![CDATA[<p>As a Flex Developer in this day and age, you’ll undoubtedly be asked to connect an application to some social media API sooner or later. If you’ve undergone this process already, you may know that this can bring a host of difficulties and hassles. I have found that each service presents a unique set of challenges that you’ll need to overcome in order to get your application all wired up and communicating with the services’ publicly exposed methods. That being said, I’ve never had more difficulty consuming a web service from an AIR application than I recently encountered while connecting a client application to LinkedIn’s API. <span id="more-597"></span> </p>
<p>Many of the differences you’ll encounter in connecting to popular social media sites has to do with the tooling available to Flex Developers targeting the AIR runtime. Many services (Facebook, Twitter, LinkedIn to name a few) utilize OAuth 2.0 protocol for interacting with users’ data in a secure way. OAuth, in case you’re not familiar (and you will be very shortly), is “an open protocol to allow secure API authorization in a simple and standard method from desktop and web applications”. You can read the specification at <a href="http://tools.ietf.org/html/rfc5849">http://tools.ietf.org/html/rfc5849</a> if you want to find out more.  </p>
<p>OAuth basically requires that you do the following steps in order to allow the user the opportunity to grant access to your application to manage data on his or her behalf. This is an overview of the process. We will look at the specifics of how to connect to LinkedIn in a few moments, using the following basic information as a primer (or a review depending on your level of familiarity with this process).  </p>
<p>Step 1: Register your application with the service you wish to connect to and receive a Consumer Key and Consumer Secret.  </p>
<p>Step 2: Your application makes a request to the service to authenticate a given user. Successful completion of this step will yield a Request Token.  </p>
<p>Step 3: The application redirects the user to the service’s sign-in and authorize page, where the user must agree to allow the app to make service calls on his behalf.  </p>
<p>Step 4: The application, upon receiving the consent of the user, exchanges the Request Token for an Access Token. This token consists of two Strings, the token and the token secret, and will be used to “sign” (a secretive process we’ll discuss in a moment) the API requests.  </p>
<p>Step 5: Call the resource you wish to consume (status update, personal info, etc..), using your Access Token (and a few other variables) to sign the request.  </p>
<p>There are a numerous code libraries available for connecting to the various social media. Probably the easiest to use of these is the FacebookDesktop Object, part of the com.facebook.graph package. Right out of the box, this tool makes it quite easy to connect to Facebook’s “Graph” API, abstracting most of the ugly details of the OAuth process we’ve just enumerated. This nice little kit practically does all of the work for you, and is very simple to set up and use in your desktop app. If you need to communicate with Facebook, I highly recommend this tool.  </p>
<p>For the purposes of this post however, I’d like to focus on LinkedIn’s API. Connecting to this service represents the other end of the difficulty spectrum in my opinion, and required quite a lot of tinkering to implement successfully. I have spent many hours refining this code. It is my hope that this tutorial will fill the enormous informational void on this topic, and help out some others where I had quite a lot of difficulty.  Please grab the src folder for this sample application <a title="LinkedIn Demo App Source" href="http://clients.curiousm.com/linkedin_tutorial_src/src.zip">here</a>. There are some functions in the source that are not included in the text of this tutorial, and I think it will serve you best to actually run this application while reading along.  The tools I used to connect to LinkedIn were from the same code library I used to connect to Twitter, the OAuth lib called “oauth-as3” from iotashan <a href="http://www.iotashan.com">http://www.iotashan.com</a>. You can grab the latest source for this project from the following svn location:<a href="http://oauth-as3.googlecode.com/svn/trunk/"> http://oauth-as3.googlecode.com/svn/trunk/</a>. There is also a dependency introduced when we include the iotashan packages. Go ahead and grab the as3crypto swc from the following URL <a href="http://code.google.com/p/as3crypto/downloads/detail?name=as3crypto.swc">http://code.google.com/p/as3crypto/downloads/detail?name=as3crypto.swc</a> and include that in the build path for your project. Alternatively, you can also grab the source from google code if you prefer to see what exactly is going on under the hood, as I have in the sample application.  </p>
<p>So, let’s get into the code now. Admittedly, this isn’t the most impressive application I’ve ever written (from a UI standpoint), but the control flow is what we’re concerned with here, and the functional elements are pretty straightforward and informative.  In order to run this application, you’ll need to register an application with LinkedIn to obtain your own Consumer Key and Consumer Secrets. I’ve indicated on lines 45 and 46 of my source where your Strings should be inserted to make your application unique from LinkedIn’s perspective.  The entry point for this whole handshake process is found on line 60 in the ‘post()’ function below. This is called after you enter some comment text into the field, and hit the Submit Button on the UI.</p>
<p><code><br />
private function post():void{<br />
_comment = commentArea.text;<br />
var shOb:SharedObject = SharedObject.getLocal(_sharedObName);<br />
var tmpTok:Object = shOb.data["accessToken"];<br />
_oauthConsumer = new OAuthConsumer(_consumerKey, _consumerSecret);<br />
_signatureMethod = new OAuthSignatureMethod_HMAC_SHA1();<br />
if(tmpTok){<br />
var token:OAuthToken = new OAuthToken(tmpTok.key, tmpTok.secret);<br />
doStatusUpdate(_comment, token);<br />
} else {<br />
hiOauth_CareToDance();<br />
}<br />
}<br />
</code></p>
<p>In this function we set up some basic variables (our OAuthConsumer and OAuthSignatureMethod_HMAC_SHA1 Objects) which we’ll need for making our requests, as well as check for the possibility that we’ve already got a valid Access Token  stored in a Shared Object called ‘linkedInData.acessToken’. Let’s assume that tmpTok comes back null (line 68), and we need to go through the entire process of getting both the Request and Access Tokens from LinkedIn.  We proceed to the function called ‘hiOauth_CareToDance()’ which is the point at which we’ll be requesting the Request Token.</p>
<p><code><br />
private function hiOauth_CareToDance():void{<br />
_requestParams = generateParams(_consumerKey);<br />
_oauthReq = new OAuthRequest(_reqMeth, _requestTokenURL, _requestParams, _oauthConsumer, _token);<br />
var postData:Object = _oauthReq.buildRequest(_signatureMethod, OAuthRequest.RESULT_TYPE_POST);<br />
var urlReq:URLRequest = new URLRequest(_requestTokenURL);<br />
urlReq.method = _reqMeth;<br />
urlReq.data = postData;<br />
var loader:URLLoader = new URLLoader(urlReq);<br />
loader.addEventListener(Event.COMPLETE, onComplete);<br />
loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError);<br />
loader.load(urlReq);<br />
</code></p>
<p><code>function onComplete(evt:Event):void{<br />
loader.removeEventListener(Event.COMPLETE, onComplete); loader.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);<br />
_token = generateToken(evt.currentTarget.data);<br />
_requestParams.oauth_token = _token; authenticate(_requestParams, _token);<br />
}</p>
<p></code></p>
<p><code>function onIOError(evt:IOErrorEvent):void{<br />
trace('FAIL!');<br />
loader.removeEventListener(Event.COMPLETE, onComplete); loader.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);<br />
}<br />
}</code></p>
<p>You’ve seen URL Requests similar to this already, but the important thing to note here is that we want to make use of our OAuthRequest Object to create the data we’ll add to the URLRequest’s ‘data’ property to send along in our POST Request. I’ve passed a few variables into the constructor of this Object to set it up, and called the instance’s buildRequest method to get back an Object containing everything LinkedIn wants to see in order to issue us a Request Token. On Event.COMPLETE we move on to the function called ‘authenticate’ after adding our token (_token) to _requestParams.oauth_token. I’ve created a convenient little utility to parse the returned data from this request and turn it into an OAuthToken Object. This function is called ‘generateToken’.  In the ‘authenticate’ method we’re navigating to LinkedIn’s authentication URL, which allows the user to grant our application control to access and manipulate personal data on the user’s behalf. We also pop up a little window which gives the user a text input into which he or she will enter the 5 digit PIN number that LinkedIn’s authenticate window will supply us with. This function is called ‘popAuthWindow’.</p>
<p><code><br />
private function authenticate(params:Object, token:OAuthToken):void{<br />
var getReq:URLRequest = new URLRequest(_authenticateURL + '?oauth_token=' + token.key); navigateToURL(getReq, '_blank');<br />
popAuthWindow();<br />
}</code></p>
<p>PopAuthWindow is really quite basic as well, but the one thing to notice here is that I’ve set a variable called ‘submitCallbackFunc’ to a function called ‘authenticateCallbackFunc’ which will get called when the user clicks the ‘submit’ button in the popup window. I find this to be a little easier and more straightforward than creating a custom event for communicating between the popup and the main application, but you may have your own opinion about the cleanest way to accomplish this. This function will accept the pin number. Let’s look at this function now.</p>
<p><code><br />
private function authenticateCallbackFunc(pin:String):void{<br />
_requestParams.oauth_verifier = pin;<br />
var authReq:OAuthRequest = new OAuthRequest(_reqMeth, _accessTokenURL, _requestParams, _oauthConsumer, _token);<br />
var postData:Object = authReq.buildRequest(_signatureMethod, OAuthRequest.RESULT_TYPE_POST);<br />
var urlReq:URLRequest = new URLRequest(_accessTokenURL);<br />
urlReq.method = _reqMeth;<br />
urlReq.data = postData;<br />
var loader:URLLoader = new URLLoader(urlReq);<br />
loader.addEventListener(Event.COMPLETE, onComplete);<br />
loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError);<br />
loader.load(urlReq);<br />
</code></p>
<p><code>function onComplete(evt:Event):void{<br />
loader.removeEventListener(Event.COMPLETE, onComplete); loader.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);<br />
_token = generateToken(evt.currentTarget.data);<br />
_requestParams.oauth_token = _token.key;<br />
_requestParams.oauth_token_secret = _token.secret;<br />
var so:SharedObject = SharedObject.getLocal(_sharedObName);<br />
so.data["accessToken"] = _token;<br />
so.flush();<br />
doStatusUpdate(_comment, _token);<br />
}</p>
<p></code></p>
<p><code>function onIOError(evt:IOErrorEvent):void{<br />
trace('FAIL!');<br />
loader.removeEventListener(Event.COMPLETE, onComplete); loader.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);<br />
}<br />
}</code></p>
<p>This looks an awful lot like the ‘hiOauth_CareToDance’ function we’ve already discussed, but were the ‘_token’ variable was null before (we hadn’t yet gotten our Request Token) we are now going to have the data returned from our call to the Request Token resource. In this step, we are ostensibly trading the Request Token for an Access Token. We make use of our handy OAuthRequest Object once again to put together the variables and the signature needed to gain access to LinedIn’s Access Token resource, and populate the URLRequest’s data property with our return from the buildRequest method. On our Complete Event, we will again be given another bit of data from which we can parse our ‘oauth_token’ and ‘oauth_token_secret’.  At this point we have been fully authenticated, and have everything we need to call the actual API resources we might wish to utilize in our application. So, knowing this we can finally call the status update resource, and submit our comments we had typed into our comments text input. We do this in the ‘doStatusUpdate’ method.</p>
<p><code><br />
private function doStatusUpdate(comment:String, tok:OAuthToken):void{<br />
if(!_requestParams){<br />
_requestParams = generateParams(_consumerKey);<br />
delete _requestParams.oauth_token_secret;<br />
delete _requestParams.oauth_verifier;<br />
var oauthGen:OAuthRequest = new OAuthRequest(_reqMeth, _statusUpdateURL, _requestParams, _oauthConsumer, tok);<br />
var header:URLRequestHeader = oauthGen.buildRequest(_signatureMethod, OAuthRequest.RESULT_TYPE_HEADER);<br />
var urlReq:URLRequest = new URLRequest(_statusUpdateURL);<br />
urlReq.method = _reqMeth;<br />
urlReq.requestHeaders.push(header);<br />
urlReq.contentType = 'text/xml';<br />
urlReq.data = generateLinkedInStatusXML(comment);<br />
var loader:URLLoader = new URLLoader(urlReq);<br />
loader.addEventListener(Event.COMPLETE, onComplete);<br />
loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError);<br />
loader.load(urlReq);  </p>
<p>function onComplete(evt:Event):void{<br />
Alert.show("Your status message was successfully sent.", "Linked In Status Updated!" );<br />
}</p>
<p>function onIOError(evt:IOErrorEvent):void{<br />
// if we hit this.. our token must be expired..<br />
hiOauth_CareToDance();<br />
}<br />
}<br />
</code></p>
<p>We see some familiar elements in this, such as the OAuthRequest and the URLRequest variables, but you’ll also notice that we have introduced a URLRequestHeader in this function which we did not have previously. The reason for this is that we are now transmitting two necessary pieces of data over the wire, not just one. We have to supply our Access Token so that we can demonstrate to LinkedIn’s servers that we are legit, but we also want to send some data to update our status at the same time. This was a little tricky for me to figure out, so I’m hoping that this demo makes even one developer’s life a little easier (ten would be even better). In order to do this, we will again build the OAuth signature with the OAuthRequest, but since we are going to want to use the data property of our URLRequest for the status update XML, we need to change the mode of our OAuthRequest to OAuthRequest.RESULT_TYPE_HEADER. You’ll notice this on line 89 of the sample application. When we change the request type to header, we get back a URLRequestHeader instead of a generic Object. This we can then push into our requestHeaders array. LinkedIn is able to deal with this accordingly, and will verify the validity of this request based on the header, and not the data of our request as we had done previously.  As for the data in this step (the actual status comment), I have created a very basic ‘generateLinkedInStatusXML’ function which creates the most basic status update markup from our comment input text. You can do more with this data if you so desire. Please refer to the LinkedIn API reference pages for more information on this. </p>
<p>In addition, make sure you set the content type of your URLRequest to ‘text/xml’ or you will not have success in making this call (yet another trap I fell into during this arduous process).  There are also 2 lines of code deleting certain items from the _requestParams data before we make this request. These 2 variables were necessary in previous steps of the OAuth authentication process, but which we no longer need now that we have the Access Token. Don’t pay too much attention to these. I believe you can leave those intact, and it will have zero effect on the success of this call.  </p>
<p>OK, with a little bit of luck this request will come back successfully and our application will alert us to the fact that our status has been updated. Hop on over to your LinkedIn profile and verify that the message did make it onto your wall (or whatever they call it in LinkedIn parlance).  </p>
<p>Congratulations! You have just successfully navigated the tedious OAuth handshake, and are now able to build out a more useful and full featured application based on this new knowledge.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.curiousm.com/labs/2011/03/09/connect-to-linked-in-api-from-as3-and-adobe-air/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Flash on the IPad &amp; IPhone or the awful thought of HTML5 &#8211; A Flash Developer&#8217;s Perspective</title>
		<link>http://www.curiousm.com/labs/2010/02/26/flash-on-the-ipad-iphone-and-the-awful-thought-of-html5-a-flash-developers-perspective/</link>
		<comments>http://www.curiousm.com/labs/2010/02/26/flash-on-the-ipad-iphone-and-the-awful-thought-of-html5-a-flash-developers-perspective/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 02:32:39 +0000</pubDate>
		<dc:creator>cmmlabs</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[IPad]]></category>
		<category><![CDATA[Iphone]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Rants]]></category>
		<guid isPermaLink="false">http://curiousmindsmedia.wordpress.com/?p=548</guid>
		<description><![CDATA[We&#8217;ve been looking at the Adobe vs. Apple war over here with a bit of a jaded perspective. We&#8217;ve read a bunch of nonsense from both companies, and some reporters on the sides of both camps writing some positively absurd things (some Flash is no good for touch interfaces meme&#8230;wha?). I thought it might be [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been looking at the Adobe vs. Apple war over here with a bit of a jaded perspective. We&#8217;ve read a bunch of nonsense from both companies, and some reporters on the sides of both camps writing some positively absurd things (some Flash is no good for touch interfaces meme&#8230;wha?). I thought it might be a time for somebody from the trenches of everyday flash development to weigh in. <span id="more-548"></span>A little disclaimer or background on us, we are a 100% apple shop, phones, server and all. The only pc&#8217;s in the office are used for testing, and sending off invoices. So yeah, we&#8217;re in that weird place that a lot of flash developers find themselves in these days. I like to think we are using a little bit of the best of both worlds. We&#8217;re also about to release our first forays into the IPhone AppStore world, so I&#8217;ve got a head full of Objective-C right now&#8230;which might be why I am writing this.</p>
<p>Okay, manifesto or thesis time. My main points for this reality check are these:</p>
<ol>
<li> I don&#8217;t want the flash player on my iphone at all. Not anywhere near it.</li>
<li>HTML 5 is not going to replace Flash for web interactive anytime soon.</li>
<li>Goddamn, coding for the IPhone is tedious.  (more of an observation, really)</li>
</ol>
<p>You probably don&#8217;t agree with me on some of the points above, and I am sure that the bad &#8211; ass Ob C devs out there are going to flex, (no pun intended) but let me explain myself here. Point #1. The Flash player is a memory gobbling whore. There, I said it. There is no way that Adobe or anyone else will be able to get any virtual machine running efficiently enough for me to what to run it on my Iphone.</p>
<p>The code that I want running on my Iphone is stuff that uses memory like it was the early 80&#8242;s. Especially when its running on a device that I could wind up really needing in an emergency. (or for that matter all of the time.)</p>
<p>Point #2. I may eat my hat on this but HTML5 canvas element? Really? Am I not the only one who remembers the marquee tag? How about the fact that I have to create 6 different versions for every HTML website we put out? The real beauty of the Flash player is it&#8217;s consistency across platforms. Nothing is perfect in this regard,  but Flash is pretty damn good.</p>
<p>Point #3. Garbage Collection aside, coding for the IPhone is pretty darn laborious. And that brings me to an important point: Flash, hands down has the best toolsets to code in, period. (I say this as I&#8217;ll be cursing a corrupted Flex dot-dammit project file tomorrow.)</p>
<p>The conclusion of this ill advised mess is that Flash is going to be around for quite sometime. Not on Apple&#8217;s mobile devices, and for good reason. And honestly, not for serving up video on the web either. And here is the kicker. I think that the flash developer&#8217;s toolset will evolve to match the current popular platforms, One IDE to rule them all&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.curiousm.com/labs/2010/02/26/flash-on-the-ipad-iphone-and-the-awful-thought-of-html5-a-flash-developers-perspective/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
