<?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>BritishIdeas &#187; Flash</title>
	<atom:link href="http://www.britishideas.com/category/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.britishideas.com</link>
	<description>Interesting Tech Projects</description>
	<lastBuildDate>Mon, 06 Sep 2010 05:34:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Compiling OpenScales 1.1 with FlashDevelop 3</title>
		<link>http://www.britishideas.com/2010/02/07/compiling-openscales-1-1-with-flashdevelop-3/</link>
		<comments>http://www.britishideas.com/2010/02/07/compiling-openscales-1-1-with-flashdevelop-3/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 05:00:47 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Mapping]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[Mapnik]]></category>

		<guid isPermaLink="false">http://www.britishideas.com/?p=165</guid>
		<description><![CDATA[This article describes how to compile the OpenScales mapping library for Flash in FlashDevelop 3. OpenScales is an open source LGPL library for displaying interactive maps using Flex and Actionscript. It has many of the features of OpenLayers. FlashDevelop 3 is a free Flash development environment and can be used with the Flex SDK from]]></description>
			<content:encoded><![CDATA[<p>This article describes how to compile the <a href="http://www.openscales.org" target="_blank">OpenScales</a> mapping library for Flash in <a href="http://www.flashdevelop.org" target="_blank">FlashDevelop</a> 3. OpenScales is an open source LGPL library for displaying interactive maps using Flex and Actionscript. It has many of the features of <a href="http://www.openlayers.org" target="_blank">OpenLayers</a>. FlashDevelop 3 is a free Flash development environment and can be used with the Flex SDK from Adobe.</p>
<p>This article assumes you already have the Flex 3 SDK and FlashDevelop 3 installed and working. See my <a href="http://www.britishideas.com/2008/02/27/first-steps-with-flash-using-the-flex-3-sdk/" target="_blank">post from two years ago</a> for help.<span id="more-165"></span></p>
<p><strong>Compilation Options</strong></p>
<p>There are two ways OpenScales can be compiled. Firstly the source code can be included with your application code. This approach is good for debugging OpenScales and learning how it works. My understanding of the OpenScales <a href="http://openscales.org/userguide/license.html" target="_blank">LGPL license</a> is that this will make your application also licensed as LGPL (or a compatible license). However I&#8217;m not a lawyer so if that aspect is important to you then you will need to take a closer look.</p>
<p>The second way to compile OpenScales is as a library (SWC file). This library can then be linked with your application to produce the final Flash file.</p>
<p><strong>Compiling OpenScales Into a Library</strong></p>
<p>1. Download and install the <a href="http://sourceforge.net/projects/exportswc" target="_blank">ExportSWC plugin</a> for Flash Develop.</p>
<p>2. Create a new Flex 3 project with no package name.</p>
<p>3. Check out OpenScales using Subversion into the folder above the project folder. Note that if you use a different location the paths in the rest of this tutorial will need to be adjusted accordingly. I recommend <a href="http://tortoisesvn.tigris.org/" target="_blank">TortoiseSVN</a> if using Windows.</p>
<p>4. Go to Project -&gt; Properties -&gt; Compiler Options. Click on the Additional Compiler Options field and then the small &#8220;&#8230;&#8221; button.</p>
<p>5. Enter:</p>
<pre class="brush: plain;">
-namespace http://openscales.org ..\OpenScales-1.1\src\openscales-fx\src\main\flex\META-INF\manifest.xml
</pre>
<p>Note the hyphen at the start of the line.</p>
<p>6. Click on the Classpaths tab and add the following Classpaths:</p>
<p><code>..\OpenScales-1.1\src\openscales-core\src\main\flex<br />
..\OpenScales-1.1\src\openscales-fx\src\main\flex<br />
..\OpenScales-1.1\src\openscales-proj4as\src\main\flex<br />
C:\Program Files\FlexSDK\frameworks\libs<br />
C:\Program Files\FlexSDK\frameworks\locale\en_US</code></p>
<p>then close the dialog window. Note if you copied the Flex 3 SDK to a different location then choose the correct location when adding the libs and locale classpaths.</p>
<p>7. Download <a href="http://gskinner.com/libraries/gtween" target="_blank">GTween</a>, extract the zip file and copy GTween_xx_xx.swc into the lib folder for the project.</p>
<p>8. In the Project tree view right click on the GTween SWC file and choose &#8220;Add To Library&#8221;. The name will turn blue.</p>
<p>9. In the Project tree expand &#8220;libs&#8221; and &#8220;locale&#8221;, right-click on each SWC file in turn and choose &#8220;Add To Library&#8221;. The names will turn blue.</p>
<p>10. Click on the Build SWC toolbar button to generate the SWC file.</p>
<p>You may get two warnings for the OverviewMap.mxml file, which causes the build to fail. I think this is a bug in FlashDevelop because warnings shouldn&#8217;t cause the build to fail, only errors should. However the warnings can be disabled in the compiler options. I don&#8217;t know for sure if the Overview Map control is usable because of this.</p>
<p>The generated SWC file will be in the bin subfolder. In FlashDevelop create a new Flex 3 project and copy the OpenScales SWC file into the lib folder, then add it to the library by right-clicking on the name in the Project tree and choosing &#8220;Add To Library&#8221;. OpenScales can now be used.</p>
<p><strong>Compiling Application Code With OpenScales Code</strong></p>
<p>1. Create a new Flex 3 project with a suitable package name.</p>
<p>2. Check out OpenScales using Subversion into the folder above the project folder. Note that if you use a different location the paths in the rest of this tutorial will need to be adjusted accordingly. I recommend <a href="http://tortoisesvn.tigris.org/" target="_blank">TortoiseSVN</a> if using Windows.</p>
<p>3. Go to Project -&gt; Properties -&gt; Compiler Options. Click on the Additional Compiler Options field and then the small &#8220;&#8230;&#8221; button.</p>
<p>4. Enter:</p>
<pre class="brush: plain;">
-namespace http://openscales.org ..\OpenScales-1.1\src\openscales-fx\src\main\flex\META-INF\manifest.xml
</pre>
<p>Note the hyphen at the start of the line.</p>
<p>5. Click on the Classpaths tab and add the following Classpaths:</p>
<p><code>..\OpenScales-1.1\src\openscales-core\src\main\flex<br />
..\OpenScales-1.1\src\openscales-fx\src\main\flex<br />
..\OpenScales-1.1\src\openscales-proj4as\src\main\flex<br />
</code></p>
<p>then close the dialog window.</p>
<p>6. Download <a href="http://gskinner.com/libraries/gtween" target="_blank">GTween</a>, extract the zip file and copy GTween_xx_xx.swc into the lib folder for the project.</p>
<p>7. In the Project tree view right click on the GTween SWC file and choose &#8220;Add To Library&#8221;. The name will turn blue.</p>
<p>Now you can add OpenScales controls to Main.mxml and build a Flex/ActionScript 3 project.</p>
<p>It is possible to add the GTween source code to the project instead of the SWC if needed.</p>
<p>You may get two warnings for the OverviewMap.mxml file, which causes the build to fail. I think this is a bug in FlashDevelop because warnings shouldn&#8217;t cause the build to fail, only errors should. However the warnings can be disabled in the compiler options. I don&#8217;t know for sure if the Overview Map control is usable because of this.</p>
<p>For completeness my MXML and ActionScript test code follows. Note that I avoided using MXML to create any controls, instead preferring to use ActionScript. This is just a personal preference.</p>
<p>Example Main.mxml file:</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
xmlns:os=&quot;http://openscales.org&quot; layout=&quot;horizontal&quot; horizontalAlign=&quot;left&quot;
backgroundColor=&quot;#FFFFFF&quot; backgroundGradientColors=&quot;[#FFFFFF, #FFFFFF]&quot;
paddingTop=&quot;0&quot; paddingLeft=&quot;0&quot; paddingRight=&quot;0&quot; paddingBottom=&quot;0&quot;
creationComplete=&quot;OSMap.main();&quot;&gt;
&lt;/mx:Application&gt;
</pre>
<p>Example OSMap.as file:</p>
<pre class="brush: as3;">
package com.britishideas
{
  import mx.controls.*;
  import mx.core.*;
  import mx.events.FlexEvent;
  import flash.events.*;
  import flash.utils.*;
  import flash.display.Sprite;
  import org.openscales.fx.FxMap;
  import org.openscales.core.Map;
  import org.openscales.core.layer.osm.Mapnik;
  import org.openscales.core.handler.mouse.DragHandler;
  import org.openscales.core.handler.mouse.WheelHandler;
  import org.openscales.core.control.PanZoomBar;

  public class OSMap
  {
    private static var map:FxMap;
    private static var mxmlApp:Application;
    private static var osmap:Map;

    public function OSMap()
    {
    }

    public static function main():void
    {
      mxmlApp = Application(Application.application);
      map = new FxMap();
      map.width = 840;
      map.height = 840;
      map.zoom = 10;
      mxmlApp.addChild(map);
      map.addEventListener(FlexEvent.CREATION_COMPLETE, MapCreated);
    }

    private static function MapCreated(e:FlexEvent):void
    {
      osmap = map.map;
      var MapnikLayer:Mapnik = new Mapnik(&quot;Mapnik&quot;, true);
      osmap.addLayer(MapnikLayer);
      var dragHandler:DragHandler = new DragHandler(osmap, true);
      var wheelHandler:WheelHandler = new WheelHandler(osmap, true);
      osmap.zoom = 10;
      osmap.addControl(new PanZoomBar());
    }
  }
}
</pre>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d165').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark to:</em></strong></a>
<br />
<div class="d165" style="overflow:hidden">
<br />
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d165').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<script type="text/javascript">$$('div.d165').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); </script>]]></content:encoded>
			<wfw:commentRss>http://www.britishideas.com/2010/02/07/compiling-openscales-1-1-with-flashdevelop-3/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>First Steps With Flash Using The Flex 3 SDK</title>
		<link>http://www.britishideas.com/2008/02/27/first-steps-with-flash-using-the-flex-3-sdk/</link>
		<comments>http://www.britishideas.com/2008/02/27/first-steps-with-flash-using-the-flex-3-sdk/#comments</comments>
		<pubDate>Thu, 28 Feb 2008 04:53:18 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://www.britishideas.com/2008/02/27/first-steps-with-flash-using-the-flex-3-sdk/</guid>
		<description><![CDATA[This post contains some step by step instructions on getting started with free Flash development using the Flex 3 SDK and FlashDevelop, both free.
I noticed that the getting started tutorials on the Adobe website are aimed at people who have purchased the Flash Builder package, so skip over some of the important details required for]]></description>
			<content:encoded><![CDATA[<p>This post contains some step by step instructions on getting started with free Flash development using the Flex 3 SDK and FlashDevelop, both free.</p>
<p>I noticed that the getting started tutorials on the Adobe website are aimed at people who have purchased the Flash Builder package, so skip over some of the important details required for using the free Flex 3 SDK. This post is an adaptation of <a href="http://opennfo.wordpress.com/2007/08/07/getting-started-with-flex-development-and-why-its-worth-learning/">Getting Started With Flex Development And Why Its Worth Learning</a>.</p>
<ul>
<li>Download the Flex 3 SDK from <a href="http://www.adobe.com/go/flex_trial">Here</a>.</li>
<li>Extract the contents of the ZIP file to somewhere like C:\Program Files\Flex3SDK</li>
<li>Add C:\Program Files\Flex3SDK\bin to the PATH variable (Control Panel -&gt; System -&gt; Advanced -&gt; Enironment Variables)</li>
<li>Install the debug version of the Flash player from C:\Program Files\Flex3SDK\runtimes\player</li>
</ul>
<p>Next we need to get FlashDevelop, which is a great, and free, IDE for Flash Development.</p>
<ul>
<li>Download FlashDevelop from <a href="http://www.flashdevelop.org/community/viewforum.php?f=11">here</a></li>
<li>Install</li>
<li>Go to Tools -&gt; Program Settings -&gt; AS3Context</li>
<li>For the setting &#8220;Flex SDK Location&#8221; specify C:\Program Files\Flex3SDK</li>
<li>Click on &#8220;Close&#8221;</li>
</ul>
<p>Now you can follow the rest of the short tutorial at <a href="http://opennfo.wordpress.com/2007/08/07/getting-started-with-flex-development-and-why-its-worth-learning/">Getting Started With Flex Development And Why Its Worth Learning</a> starting with the point where a new ActionScript file is created. Within minutes you will have your first flash script built with debug output!</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d56').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark to:</em></strong></a>
<br />
<div class="d56" style="overflow:hidden">
<br />
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d56').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<script type="text/javascript">$$('div.d56').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); </script>]]></content:encoded>
			<wfw:commentRss>http://www.britishideas.com/2008/02/27/first-steps-with-flash-using-the-flex-3-sdk/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
