<?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>The Knowledge Supply Chain &#187; Flash / Flex</title>
	<atom:link href="http://www.ipov.net/apps/blog/category/flash_flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ipov.net/apps/blog</link>
	<description></description>
	<lastBuildDate>Fri, 17 Jun 2011 21:52:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Starting an adventure with Gradle</title>
		<link>http://www.ipov.net/apps/blog/2011/06/starting-gradle-adventure/</link>
		<comments>http://www.ipov.net/apps/blog/2011/06/starting-gradle-adventure/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 21:52:57 +0000</pubDate>
		<dc:creator>robert.sanders</dc:creator>
				<category><![CDATA[CoSolvent Flash Player]]></category>
		<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[CFP]]></category>
		<category><![CDATA[OSMF]]></category>

		<guid isPermaLink="false">http://www.ipov.net/apps/blog/?p=638</guid>
		<description><![CDATA[We&#8217;ve been getting back into gear to start development of CoSolvent Flash Player version 2; which will really be the 5th major release of our core logic as the player was previously a more or less nameless piece of internal code.  The new version will be based on Adobe&#8217;s OSMF which we&#8217;ve been following with [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been getting back into gear to start development of CoSolvent Flash Player version 2; which will really be the 5th major release of our core logic as the player was previously a more or less nameless piece of internal code.  The new version will be based on Adobe&#8217;s OSMF which we&#8217;ve been following with interest for quite some time now.</p>
<p>We made a couple decisions up-front, and one of them was to import the latest release code drops from OSMF into an internal git repository; that way if we ever need to make any patches we have the code right there, and anyway as with any open source project it can be very useful to go through the source code to understand how best to use it.  So that decision brought on the next, which was: do we go ahead and setup to build the osmf.swc library ourselves.  After debating this, we decided that it would provide useful experience.  Alas the OSMF SVN lacks a decent build script, seeming to rely on FlashBuilder.  Luckily the Strobe Media Player does have a basic set of ANT build scripts.  Now, I&#8217;ve been using ANT for quite some time, and everytime I have to use it on a new project I ask myself: isn&#8217;t there anything better?  So far the answer has been &#8220;no&#8221;.  So, I started working through an attempt to modularize the SMP build script.  I believe I managed to get something that was workable, while being fairly ugly; however along the way I decided that the build for CFP 2.0 should be cleaner if at all possible and decided to go though another search.</p>
<p>Of course one of the obvious tools for any Java developer such as myself has got to be Maven, although up until now I have avoided it, having found it approach too constrictive for my comfort, and that making the transition seems to involve an awful lot of new things to learn, which are not super well documented (not that most other open source tools are really much better).  We also have a (so far) internal tool built using the Eclipse RCP framework, and had also started to look at the e4 projects as the next logical step there; but again, the Eclipse build tooling always has struck me as incredibly non-user friendly.  The big problem we run into is that, because a number of tools that we want access to are part of various plugins (such as XML editing), we end up shipping a whole bunch of the IDE functionality, and that creates a huge set of dependencies to manage.  Now, if you have all day, you can simply re-provision them each time you need to build, downloading the latest stable releases, but that is not going to work for incremental builds.  So we are left with the question of managing a &#8220;target platform&#8221; full of modules (features and related plugins) that we want to keep up-to-date, and we don&#8217;t have a separate build developer.  One of the developments that caught our attention was the Tycho project, which seemed to address some of the issues, and since Tycho is built on top of Maven3 that seemed to provide some added incentive to consider moving to Maven.</p>
<p>Starting out with maven was somewhat ugly, as the maven way of doing things seems to be mostly derived from the process that a Java project might need, but we kept learning.  There is a &#8220;flex mojo&#8221; to add the ability to call mxmlc and compc from within a maven build as a semi-standard part of their lifecycle; however we quickly ran into a problem.  We need to control the version(s) of flex we are compiling with/against.  Apparently this used to be possibly, however after getting a few too many complaints from users who&#8217;d shot themselves in the foot with a path issue, the one guy who maintains the flex mojo basically decided to do his best to make this &#8220;impossible&#8221; for new users (see his discussion board postings).  In addition to creating technical problems, the attitude also raised a number of questions in our minds about if we really wanted to go that route.  In the end we decided that since the Tycho tool chain was not yet ready for us (or we weren&#8217;t ready for it), there was not really a compelling reason to use Maven.  So it was back to the drawing board.</p>
<p>After looking at numerous tools, I finally rediscovered Gradle.  I say rediscover because I&#8217;d previously seen it, when it was in a much less mature state.  Anyway, a quick google showed that not only would it be possible, due to Gradle&#8217;s built in support for ANT tasks, to use the Adobe mxmlc and compc tasks, but that just recently work had started on a plugin for adding even better support for Flex development into Gradle as a plugin &#8211; <a title="GradleFx on GitHub" href="https://github.com/GradleFx" target="_blank">GradleFx</a></p>
<p>So, I started working on a test of using gradle to compile the OSMF code and plugins.  At this point, as I&#8217;d anticipated, I managed to run into a number of beginner issues; however I have been able to work my way through them, with the kind help of input from the GradleFx developers.  One thing I&#8217;ll note here is that you can avoid having to &#8220;install&#8221; the GradleFx plugin into a local maven cache by simply putting it in a local folder and declaring that as a &#8220;flat repo&#8221; like:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="groovy" style="font-family:monospace;">buildscript <span style="color: #66cc66;">&#123;</span>
     repositories <span style="color: #66cc66;">&#123;</span>
        flatDir name: <span style="color: #ff0000;">'localToolsRepository'</span>, dirs: <span style="color: #ff0000;">&quot;${buildTools}/lib&quot;</span>
    <span style="color: #66cc66;">&#125;</span>
    dependencies <span style="color: #66cc66;">&#123;</span>
        classpath group: <span style="color: #ff0000;">'org.gradlefx'</span>, name: <span style="color: #ff0000;">'gradlefx'</span>, version: <span style="color: #ff0000;">'0.2.1.ipov'</span>, ext: <span style="color: #ff0000;">'jar'</span>
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>Note that the buildscript closure is evaluated right away, before the rest of the build, so if you want to use any variables, such as ${buildTools} in the example above, then you have to define them in a gradle.properties file.</p>
<p>I found that cloning the GradleFx repo enabled me to look over the code and get a better feel for what its doing, as the documentation is still a little light; however I soon found that I had a couple of ideas for some changes to the GradleFx code.  Since this is on GitHub, I decided to try my first ever GitHub hosted fork.  The process seems to have gone well, and so far I&#8217;ve been able to contribute a small change in the path handling.  I am currently working on code to add explicit includeSources and includeClasses properties to at least the compc code, as currently the compc implementation is using all the declared source-paths as include-sources too, which is going to work most of the time, but not all.  This should then mean you can reuse .flexLibProperties &#8211; something that the SMP build does, but much more simply.  I have the following as a part of a multi-project build (OSMF comes as several different components that I&#8217;m building separately):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>120
121
122
123
124
125
</pre></td><td class="code"><pre class="groovy" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">def</span> flexLibProperties <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> XmlParser<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">parse</span><span style="color: #66cc66;">&#40;</span> project.<span style="color: #006600;">file</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'.flexLibProperties'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
<span style="color: #000000; font-weight: bold;">def</span> incClasses <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">;</span>
flexLibProperties.<span style="color: #006600;">includeClasses</span>.<span style="color: #006600;">classEntry</span>.<span style="color: #663399;">each</span> <span style="color: #66cc66;">&#123;</span>
    incClasses.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span> it.<span style="color: #ff0000;">'@path'</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
<span style="color: #66cc66;">&#125;</span>
project.<span style="color: #006600;">tasks</span>.<span style="color: #006600;">compile</span>.<span style="color: #006600;">includeClasses</span> <span style="color: #66cc66;">=</span> incClasses</pre></td></tr></table></div>

<p>I am considering pushing my OSMF repo to GitHub, but my big hang up is that right now I am unsure how much TLC I&#8217;m going to be able to give it, and I don&#8217;t want to create any false expectations from others.  For instance, if it becomes clear that we&#8217;re not going to need to have the ability to build OSMF ourselves, then it would be much simpler to just use the latest binary.  However, in the mean time I intend to try and post a few other tips and try to contribute any other ideas I have to the GradleFx project.</p>
<div class="printfriendly alignleft"><a href="http://www.ipov.net/apps/blog/2011/06/starting-gradle-adventure/?pfstyle=wp" rel="nofollow" ><img src="//cdn.printfriendly.com/pf-button.gif" alt="Print Friendly" /></a></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.ipov.net%2Fapps%2Fblog%2F2011%2F06%2Fstarting-gradle-adventure%2F&amp;title=Starting%20an%20adventure%20with%20Gradle" id="wpa2a_2"><img src="http://www.ipov.net/apps/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.ipov.net/apps/blog/2011/06/starting-gradle-adventure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Options for Embedding Video IN a Document File</title>
		<link>http://www.ipov.net/apps/blog/2009/09/options-for-embedding-video-in-a-document-file/</link>
		<comments>http://www.ipov.net/apps/blog/2009/09/options-for-embedding-video-in-a-document-file/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 05:01:12 +0000</pubDate>
		<dc:creator>vic.uzumeri</dc:creator>
				<category><![CDATA[Business Issues]]></category>
		<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[Processing Methods]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[acrobat]]></category>
		<category><![CDATA[embedding]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.ipov.net/blog/?p=440</guid>
		<description><![CDATA[With companies effectively using video on websites, why would anyone be interested in the fairly challenging task of embedding video directly in Word and PDF documents? In general, there is little need to embed video directly inside of office documents. However, there are situations where embedding may be the best (or only) way to ensure [...]]]></description>
			<content:encoded><![CDATA[<p>With companies effectively using video on websites, why would anyone be interested in the fairly challenging task of embedding video directly in Word and PDF documents? In general, there is little need to embed video directly inside of office documents. However, there are situations where embedding may be the best (or only) way to ensure that the documents and video can be viewed together reliably. Some of these situations are common enough that iPOV was motivated to develop special tools and processes to make the task easier.<span id="more-440"></span></p>
<p>The following scenarios illustrate situations where video-embedded documents might be handy and you can review the options in a<strong> lot</strong> more detail in this extended <a href="http://www.ipov.net/assets/EmbeddingVideoInDocuments.pdf">whitepaper</a>.</p>
<ul>
<li>Large company IT departments are pushing employees to store their      business documents in secure document management systems like SharePoint      or Lotus Notes. These systems enforce enhanced security and offer document      control safeguards that are difficult to replicate on standard web      servers. Documents with embedded video coexist very nicely with these      systems.</li>
<li>For security reasons, the same IT departments may resist the      proliferation of intranet or extranet web server applications. Even if a      document could be hosted on a web server, policy restrictions or resource      costs may make that difficult for people in business units and non-IT      departments. Those individuals can author video-enhanced PDF or DOC files      without requiring any special IT support.</li>
<li>Although this problem is diminishing, companies with highly mobile      workforces may still have people operating in places where web      connectivity is marginal or nonexistent. Field service crews, overseas      offices in developing economies and personnel co-located behind strict      client firewalls may not be able to reach key company websites. They can      carry a library of video-enabled documents on a hard disk, thumb drive, or      CD.</li>
<li>Most employees in large organizations use Microsoft Word and it      would be convenient if all forms of publishing could be done with that      tool. However, to work with other programs, Word documents often must be      exported to another format. If you add video into the mix, that gets very      complicated. One iPOV client found that, by converting Word originals to      PDFs and embedding video, the resulting documents became much more      universal. A given PDF document with embedded video can be stored in      SharePoint, loaded into the Learning Management System, linked and made      viewable online at a website, or emailed to parties outside the company.  One file, many uses.</li>
<li>A similar situation occurred in a global multinational. Divisions      around the world each had their own Learning Management System, some of      which were old and not standards-compliant. If they published eLearning in      the customary SCORM or AICC packaging it would have taken a lot of effort      to import it into all of the varied, regional servers. However, every LMS      (even the old and non-standard ones) could import and display a PDF. By      packaging the video inside the PDF, the courseware effectively became a      universal commodity.</li>
</ul>
<h2>Examples</h2>
<p style="text-align: left;">(click on the images and captions to view PDFs with embedded video at iPOV’s website)</p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="100" valign="top">
<p style="text-align: center;" align="center"><a href="http://demo.cosolvent.com/ccs/main.php?g2_itemId=4381&amp;g2_typeView=GridView"><img title="sshTunneling" src="http://www.ipov.net/blog/wp-content/uploads/2009/09/sshTunneling-150x150.png" alt="sshTunneling" width="150" height="150" /></a><a href="http://demo.cosolvent.com/ccs/main.php?g2_itemId=4381&amp;g2_typeView=GridView">memo</a></p>
</td>
<td width="180" valign="top">
<p style="text-align: center;"><a href="http://demo.cosolvent.com/ccs/main.php?g2_itemId=4378&amp;g2_typeView=GridViewo.cosolvent.com/ccs/main.php?g2_view=core.DownloadItem&amp;g2_itemId=4378&amp;g2_d1=1"><img title="corporatePolicy" src="http://www.ipov.net/blog/wp-content/uploads/2009/09/corporatePolicy-150x150.png" alt="corporatePolicy" width="150" height="150" /></a><a href="http://demo.cosolvent.com/ccs/main.php?g2_itemId=4378&amp;g2_typeView=GridViewo.cosolvent.com/ccs/main.php?g2_view=core.DownloadItem&amp;g2_itemId=4378&amp;g2_d1=1">policy</a></p>
</td>
<td width="102" valign="top">
<p style="text-align: center;"><a href="http://demo.cosolvent.com/ccs/main.php?g2_itemId=9926&amp;g2_typeView=GridView"><img title="economicDevelopment" src="http://www.ipov.net/blog/wp-content/uploads/2009/09/economicDevelopment-150x150.png" alt="economicDevelopment" width="150" height="150" /></a><br />
<a href="http://demo.cosolvent.com/ccs/main.php?g2_itemId=9926&amp;g2_typeView=GridView">PR</a></p>
</td>
</tr>
<tr>
<td width="100" valign="top">
<p style="text-align: center;"><a href="http://demo.cosolvent.com/ccs/main.php?g2_itemId=1015&amp;g2_typeView=GridView"><img title="realEstate" src="http://www.ipov.net/blog/wp-content/uploads/2009/09/realEstate-150x150.png" alt="realEstate" width="150" height="150" /></a><br />
<a href="http://demo.cosolvent.com/ccs/main.php?g2_itemId=1015&amp;g2_typeView=GridView">sales</a></p>
</td>
<td width="180" valign="top">
<p style="text-align: center;"><a href="http://demo.cosolvent.com/ccs/main.php?g2_itemId=4375&amp;g2_typeView=GridView"><img title="workProcedure" src="http://www.ipov.net/blog/wp-content/uploads/2009/09/workProcedure-150x150.png" alt="workProcedure" width="150" height="150" /></a><a href="http://demo.cosolvent.com/ccs/main.php?g2_itemId=4375&amp;g2_typeView=GridView"><br />
SOP</a></p>
</td>
<td width="102" valign="top">
<p style="text-align: center;"><a href="http://demo.cosolvent.com/ccs/main.php?g2_itemId=9923&amp;g2_typeView=GridView"><img title="xprocessScrum" src="http://www.ipov.net/blog/wp-content/uploads/2009/09/xprocessScrum-150x150.png" alt="xprocessScrum" width="150" height="150" /></a><a href="http://demo.cosolvent.com/ccs/main.php?g2_itemId=9923&amp;g2_typeView=GridView">eLearning</a></p>
</td>
</tr>
</tbody>
</table>
<p>You can view more examples at iPOV’s website: <a href="../../content/rich-media-pdf">http://www.ipov.net/content/rich-media-pdf</a></p>
<h2>Gotchas</h2>
<p>A fast-moving technology always generates surprises that initially baffle newcomers. These are the surprising limitations and gotchas that dictate what is actually possible. Accordingly, we begin this guide with a list of the key constraints that we have learned to work around:</p>
<ol>
<li><strong>Can I put a video into a Word Document and have it viewable and      playable on the Page?</strong><br />
No. You can create that impression if you insert a Windows Media ‘object’      into your document, but the video won’t actually be inside the Word file.      It will be an external file that the document is linked to, and you must      manage this linkage yourself. You <strong>can</strong> put a movie inside the Word file, but it will appear as a small icon that      you must click to open. It is theoretically possible that a skilled      programmer can write a macro or plugin to make this possible, but iPOV has      not seen any developer activity in this area.</li>
<li><strong>Can I put a video into a Word document and then save it as a PDF?</strong><br />
Not reliably or well. iPOV is not aware of any tool that will reliably      export a video-embedded Word document to PDF and have the video play      correctly. First, if the video is in a typical, common movie format (MP4, AVI,      WMV, MOV, etc.), it should first be converted into a Flash movie –      something PDF exporting software won’t do.<a href="#_ftn1">[1]</a> Second, if the movie embedded in the Word document is already a Flash      movie, the resulting embedded movie will have very limited play control      (see point #3).</li>
<li><strong>Can I add a Flash video to a PDF using Acrobat Pro?<br />
</strong>You can add a FLV or H.264 video or SWF animation easily enough, but the      Flash Player doesn’t supply any play controls (start, stop, pause, tracker      bar, volume, etc.). This is a big drawback in business situations where      the viewer may want to review a key point or adjust the sound volume. To      get good play controls, it is necessary to package the video and play      controls together into an SWF file (e.g., using an external editor such as      Adobe Flash) and insert the unified SWF file into the PDF.<a href="#_ftn2">[2]</a> <strong> </strong></li>
<li><strong>Why haven’t I seen more PDFs with embedded video – it looks really      cool?<br />
</strong>Acrobat has supported embedding videos since version 6. The problem      for business documents comes down to workflow – see answer #2 above.  In general if you want to edit the text      of a document you will do so in Word and then re-publish it to a PDF.  At this point someone must individually re-insert      all the videos from the old PDF into the new PDF. iPOV has developed a set      of processes and procedures to help us do this quickly and correctly and      we are working on tools to automate the process even more.<a href="#_ftn3">[3]</a><sup>,    <a href="#_ftn4">[4]</a></sup></li>
<li><strong>Why not put the videos on YouTube and link them to a document?</strong><br />
YouTube (and most sites like it) caters to people who want wide public distribution      for their files. It has a very basic security system and it may be often      blocked by corporate firewalls. Sites like these also tend to display ads      that may or may not fit with your corporate image.</li>
</ol>
<hr size="1" /><a href="#_ftnref1">[1]</a> Adobe now recommends embedding H.264 or FLV videos for pre-edited movies. You can use non-Flash video in PDFs, but Acrobat will try to find a suitable video player program on the user’s system. If it cannot find a player already installed, it will likely fail.</p>
<p><a href="#_ftnref2">[2]</a> The latest version of Acrobat Pro has an alternative way to import linked files, but it is finicky and prone to error. It is also more difficult to debug any broken links once the files have been imported.</p>
<p><a href="#_ftnref3">[3]</a> When documents are designed for large numbers of end users, it is often easier link to a video on a web server rather than distribute a packaged document.<ins datetime="2009-08-10T22:08" cite="mailto:vic%20uzumeri"></ins></p>
<p><a href="#_ftnref4">[4]</a> Note also that recent security changes have made some old documents no longer playable.</p>
<div class="printfriendly alignleft"><a href="http://www.ipov.net/apps/blog/2009/09/options-for-embedding-video-in-a-document-file/?pfstyle=wp" rel="nofollow" ><img src="//cdn.printfriendly.com/pf-button.gif" alt="Print Friendly" /></a></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.ipov.net%2Fapps%2Fblog%2F2009%2F09%2Foptions-for-embedding-video-in-a-document-file%2F&amp;title=Options%20for%20Embedding%20Video%20IN%20a%20Document%20File" id="wpa2a_4"><img src="http://www.ipov.net/apps/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.ipov.net/apps/blog/2009/09/options-for-embedding-video-in-a-document-file/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Flash development with open source tools</title>
		<link>http://www.ipov.net/apps/blog/2009/09/flash-dev-environment-with-open-source-tools/</link>
		<comments>http://www.ipov.net/apps/blog/2009/09/flash-dev-environment-with-open-source-tools/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 03:33:30 +0000</pubDate>
		<dc:creator>joseph.gay</dc:creator>
				<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flashdevelop]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://www.ipov.net/blog/?p=94</guid>
		<description><![CDATA[A start to finish guide for setting up an Actionscript 3 development environment using open source tools that will work within the context of an agile process on Linux, or Windows.]]></description>
			<content:encoded><![CDATA[<p><strong>Why?</strong></p>
<ul>
<li><span style="background-color: #ffffff;">You want to do Flash work that is mostly development oriented. The environment described here will be useful for a programmer or small team using supplements from a designer as opposed to a designer working in the Flash IDE with supplements from a programmer.</span></li>
<li><span style="background-color: #ffffff;">You want a command line interface and a tool chain that can work easily with existing continuous integration and web deployment tools.</span></li>
</ul>
<p><span id="more-94"></span></p>
<p>The following steps will take you through the required set up for a sample project. There is a link to the full source at the end.</p>
<p><strong>Step 1: Download the Flex SDK</strong></p>
<p>Adobe&#8217;s open source <a title="Flex SDK 3 Download" href="http://www.adobe.com/cfusion/entitlement/index.cfm?e=flex3sdk">Flex SDK</a> provides, among other things, an Actionscript compiler binary: mxmlc. It&#8217;s not just useful for compiling mxml based Flex applications however; it can also be used to compile lightweight, pure Actionscript 3 projects. The download will consist of a single zip file which you may extract to a directory of your choice. On windows, I choose c:\flex, and on linux I choose /usr/local/share/adobe-flex/sdk. You&#8217;ll just need to remember the path when you set up your build environment. Note that for the compiler to work, you&#8217;ll need to have Java 1.6+ installed.</p>
<p><strong>Step 2: Download the Flash debugger standalone player and plugins</strong></p>
<p>Ok, so this part isn&#8217;t open source, but you can&#8217;t have Flash these days without Adobe&#8217;s Flash player. The <a title="Adobe Flash Downloads" href="http://www.adobe.com/support/flashplayer/downloads.html">debug flash player</a> will conveniently display a stack trace whenever there&#8217;s an error. The trace will even include line numbers if you build your swfs with the debug flag, which you will see how to do below. The debug enabled browser plugins are installed in the same manner as the normal browser plugins. If you&#8217;re running Windows, installing the ActiveX control will result in having a debug enabled player in IE. On both Linux and Windows, installing the &#8216;Plugin content debugger&#8217; will give you a debug enabled player in browsers like Firefox and Chrome. The standalone player can be placed anywhere. On Linux I&#8217;ve copied the flashplayer executable to /usr/local/bin, which is on my PATH.</p>
<p><strong>Step 3: Install Ant and the Flex SDK Ant tasks</strong></p>
<p>Since the Flex SDK internals are predominately written in Java, Ant is used as the build tool of choice for most Flex and Actionscript 3 projects. Accordingly, Adobe provides a set of Ant tasks for invoking various SDK related commands from within Ant. First <a title="Apache Ant home page" href="http://ant.apache.org">install Ant</a> (if you&#8217;re on a Linux system, you&#8217;re better off using your distribution&#8217;s package manager rather than Apache&#8217;s packages). Copy the file flexTasks.jar from &lt;flex sdk path&gt;/ant/lib to your Ant installation&#8217;s lib folder. On my Ubuntu Jaunty system for example, it was /usr/share/ant/lib. You will also copy from the flex Ant folder the file flexTasks.tasks to your project folder once it is created.</p>
<p><strong>Step 4: Choosing an editor/IDE</strong></p>
<p>Now that you can compile Actionscript files and view the results, you&#8217;ll need to select an Actionscript aware editor or IDE. If you are using Vim, there are a number of syntax files around the web. I&#8217;ve had luck with the ones found on <a href="http://www.abdulqabiz.com/blog/archives/2007/10/12/vim-actionscript-and-mxml-syntax-files/">Adbul Qabiz&#8217;s blog</a> for example. On Emacs, you will find what you need on the <a href="http://www.emacswiki.org">Emacs Wiki</a>, including some <a href="http://www.emacswiki.org/emacs/FlymakeActionscriptThree">FlyMake</a> code (build as you type). If you are running Windows, there is a tailored open source solution available: <a href="http://www.flashdevelop.org/wikidocs/index.php?title=Main_Page">FlashDevelop</a>. FlashDevelop provides IDE functionality for Actionscript 2 and 3, Flex, Air, and haXe. If you&#8217;re accustomed to Eclipse, Visual Studio, NetBeans, etc., you should feel right at home with FlashDevelop.</p>
<p><strong>Step 5: Creating a project template</strong></p>
<p>The main aim here is to build your project by issuing one command from the command line. You&#8217;ll start by creating a project folder, and inside the project folder you will create a file called build.xml for use with Ant. If you intend to collaborate with others on the project, it&#8217;s also a good idea to separate system specific variables into another file. At iPOV, we use a separate file called build-user.properties. Here are samples of both files:</p>
<pre class="brush: xml">&lt;project name="miniplayer" default="build-all" basedir="."&gt;
    &lt;description&gt;
           Builds iPOV Hello World
        To use, :
          1. Copy %flex_sdk_3%/ant/lib/flexTasks.jar  to %ANT_HOME%/lib
          2. Copy build-user.properties.default to build-user.properties
            (so it doesn't get commited to SVN) and
            edit the paths for your install.
          3. Invoke the build "&gt;ant [build-target-name]" (either via commandline of GUI launcher)
    &lt;/description&gt;

    &lt;!-- Import the property definitions. --&gt;
    &lt;property file="build-user.properties" /&gt;
    &lt;property name="PROJECT_NAME" value="ipov_hello-world"/&gt;
    &lt;property name="PROJECT_VERSION" value="1.0.0"/&gt;
    &lt;property name="DEPLOY_DIR" value="bin"/&gt;
    &lt;property name="MAIN_CLASS" value="src/net/ipov/hello_world/Main.as"/&gt;

    &lt;taskdef resource="flexTasks.tasks" classpath="${TASK_HOME}/flexTasks.jar" /&gt;

    &lt;target name="build-all" depends="build-swf,build-debug-swf"/&gt;

    &lt;target name="build-swf" depends="init"&gt;
        &lt;mxmlc file="${MAIN_CLASS}"
            output="${DEPLOY_DIR}/${PROJECT_NAME}-${PROJECT_VERSION}.swf"
            debug="false" optimize="true" fork="true"
            default-background-color="0xffffff" &gt;
            &lt;source-path path-element="src/" /&gt;
        &lt;/mxmlc&gt;
    &lt;/target&gt;

    &lt;target name="build-debug-swf" depends="init"&gt;
        &lt;mxmlc file="${MAIN_CLASS}"
            output="${DEPLOY_DIR}/${PROJECT_NAME}-${PROJECT_VERSION}.swf"
            debug="true" optimize="false" fork="true"
            default-background-color="0xffffff" &gt;
            &lt;source-path path-element="src/" /&gt;
        &lt;/mxmlc&gt;
    &lt;/target&gt;

    &lt;target name="init"&gt;
        &lt;mkdir dir="${DEPLOY_DIR}"/&gt;
    &lt;/target&gt;

&lt;/project&gt;<span style="background-color: #ffffff; font-size: small; "> </span></pre>
<pre class="brush: plain">#
# Copy this file to .user.properties and then edit it to match your system
#
FLEX_HOME=c:/flex3/sdk
TASK_HOME=c:/bin/apache-ant-1.7.1/lib</pre>
<p>Replace ipov_hello-world above with your project name, and replace the net/ipov path with the namespace you will use for your main source files.</p>
<p>If you are using FlashDevelop, you will now create a new AS3 project using Project -&gt; New Project. For Location, browse to your project folder where you have placed the two files above. For Package, type your primary namespace (net.ipov.hello_world in this example). FlashDevelop will create the necessary files and folders for you. Outside of FlashDevelop, you can simply create a folder called src, and inside place folders corresponding to your primary namespace. Then create a file called Main.as inside your primary namespace folder to act as the entry point for your application. Here the content of Main.as in the Hello, World! sample:</p>
<pre class="brush: as3">package net.ipov.hello_world
{
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.text.TextField;

    [SWF(height='300', width='400')]
    public class Main extends Sprite {

        private var _params:Object;

        public function Main():void {
            _params = root.loaderInfo.parameters ? root.loaderInfo.parameters : new Object();

            if (stage) init();
            else addEventListener(Event.ADDED_TO_STAGE, init);

        }

        private function init(e:Event = null):void {
            removeEventListener(Event.ADDED_TO_STAGE, init);
            // entry point
            var helloText:TextField = new TextField();
            helloText.text = "Hello, World!";
            stage.addChild(helloText);
        }

    }

}</pre>
<p>Once you have set up your project folder, invoke the following commands from the root of the project to build and launch the application:</p>
<pre class="brush: plain">~/projects/as3-hello-world $ ant
Buildfile: build.xml

init:

build-swf:
    [mxmlc] Loading configuration file /usr/local/share/adobe-flex/sdk/frameworks/flex-config.xml
    [mxmlc] /home/joseph/projects/as3-hello-world/build/ipov_hello-world-1.0.0.swf (833 bytes)

build-debug-swf:
    [mxmlc] Loading configuration file /usr/local/share/adobe-flex/sdk/frameworks/flex-config.xml
    [mxmlc] /home/joseph/projects/as3-hello-world/build/ipov_hello-world-1.0.0.swf (1021 bytes)

build-all:

BUILD SUCCESSFUL
Total time: 9 seconds
~/projects/as3-hello-world $ flashplayer build/ipov_hello-world-1.0.0.swf</pre>
<p>If you are using FlashDevelop, you can also use Project -&gt; Test Movie (F5 on the keyboard). When prompted to configure the compiler, set your Flex SDK location under AS3Context, and set the standalone Flash player location under FlashViewer.</p>
<p>That should be enough to get started developing AS3 applications. Future articles will include information about unit testing, continuous integration, deployment, and Adobe Captivate Widget development.</p>
<p><a href="http://www.ipov.net/blog/wp-content/uploads/2009/09/as3-hello-world.zip">as3-hello-world-source</a></p>
<div class="printfriendly alignleft"><a href="http://www.ipov.net/apps/blog/2009/09/flash-dev-environment-with-open-source-tools/?pfstyle=wp" rel="nofollow" ><img src="//cdn.printfriendly.com/pf-button.gif" alt="Print Friendly" /></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.ipov.net/apps/blog/2009/09/flash-dev-environment-with-open-source-tools/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

