<?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>charles newman&#039;s blog</title>
	<atom:link href="http://charlespatricknewman.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://charlespatricknewman.com/blog</link>
	<description>Rich Media Experience blog plus Mac tips</description>
	<lastBuildDate>Wed, 16 Nov 2011 20:14:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>iPad AirPlay Mirroring not working with Apple TV / Apple TV won&#8217;t update</title>
		<link>http://charlespatricknewman.com/blog/?p=373</link>
		<comments>http://charlespatricknewman.com/blog/?p=373#comments</comments>
		<pubDate>Sun, 23 Oct 2011 15:28:12 +0000</pubDate>
		<dc:creator>Charles Newman</dc:creator>
				<category><![CDATA[Apple TV]]></category>

		<guid isPermaLink="false">http://charlespatricknewman.com/blog/?p=373</guid>
		<description><![CDATA[If you bought a new Apple TV and AirPlay Mirroring is not working, here&#8217;s how I fixed mine: On the Apple TV, go to settings, general, about and check the software version.  If it&#8217;s 2.3, this is your problem.  There is a bug in this version that causes some Apple TV&#8217;s to not update to [...]]]></description>
			<content:encoded><![CDATA[<!-- AdSense Now V1.53 -->
<!-- Post[count: 2] -->
<div class="adsense adsense-midtext" style="float:right;margin: 12px;"><script type="text/javascript"><!--
google_ad_client = "pub-4555757068383195";
/* 125x125 button, created 4/12/09 */
google_ad_slot = "9305480042";
google_ad_width = 125;
google_ad_height = 125;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p>If you bought a new Apple TV and AirPlay Mirroring is not working, here&#8217;s how I fixed mine:</p>
<ol>
<li>On the Apple TV, go to settings, general, about and check the software version.  If it&#8217;s 2.3, this is your problem.  There is a bug in this version that causes some Apple TV&#8217;s to not update to 2.4.  So you can select Update Software all day on the Apple TV and it&#8217;s not going to work.</li>
<li>Disconnect the HDMI and power from the Apple TV.</li>
<li>Connect the Apple TV to your iMac or your Mac laptop using a mini USB cable. It will show up in iTunes.</li>
<li>Click the <del>reset</del> &#8221;Restore&#8221; button (updated after an astute reader corrected me) in iTunes for the Apple TV.  It will reset it to factory settings and install the latest Apple TV firmware.</li>
<li>When the update is finished, iTunes will tell you to disconnect it from your Mac and connect back to your TV. Do that.</li>
<li>Once the Apple TV finishes booting, go back to step 1 above and check the software version.   It should be updated now and mirroring should work.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://charlespatricknewman.com/blog/?feed=rss2&#038;p=373</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>OSMF &#8211; Loading plug-ins locally with the file:/// protocol</title>
		<link>http://charlespatricknewman.com/blog/?p=361</link>
		<comments>http://charlespatricknewman.com/blog/?p=361#comments</comments>
		<pubDate>Thu, 03 Mar 2011 22:23:30 +0000</pubDate>
		<dc:creator>Charles Newman</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Adobe Flash Builder]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[OSMF (Open Source Media Framework)]]></category>

		<guid isPermaLink="false">http://charlespatricknewman.com/blog/?p=361</guid>
		<description><![CDATA[Some of you may already know you can load an OSMF plug-in locally using the file protocol like this: For Mac: file:///Users/me/Documents/dev/projects/myproject/plugins/SomeOSMFPlugin.swf For Win: file:///C:/dev/projects/myproject/plugins/SomeOSMFPlugin.swf This is very handy when developing a player because you don&#8217;t need to copy your player to localhost or a Web server to run and test. However, I just discovered [...]]]></description>
			<content:encoded><![CDATA[<p>Some of you may already know you can load an OSMF plug-in locally using the file protocol like this:</p>
<p>For Mac:<br />
<code><br />
file:///Users/me/Documents/dev/projects/myproject/plugins/SomeOSMFPlugin.swf<br />
</code></p>
<p>For Win:<br />
<code><br />
file:///C:/dev/projects/myproject/plugins/SomeOSMFPlugin.swf</code></p>
<p>This is very handy when developing a player because you don&#8217;t need to copy your player to localhost or a Web server to run and test.</p>
<p><strong>However, I just discovered this oddity:</strong><br />
The plug-in will fail to load if the plug-in is a release build and the player is a debug build.</p>
<p>The failure happens down in the OSMF 1.5 core class <code>DynamicPluginLoader</code> in the <code>onSWFLoaderStateChange</code> method on this line:</p>
<p><code> var pluginInfo:PluginInfo = root[PLUGININFO_PROPERTY_NAME] as PluginInfo;<br />
</code></p>
<p>Flash Builder clearly shows the <code>pluginInfo</code> property on the <code>root</code> variable but the <code>pluginInfo</code> local variable is <code>null</code> after the above line executes.</p>
<p>This is not an OSMF bug, just something that you need to be aware of.  I wasted about 30 minutes on this.</p>
]]></content:encoded>
			<wfw:commentRss>http://charlespatricknewman.com/blog/?feed=rss2&#038;p=361</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dynamically loading a SWF and instantiating a Class in that SWF</title>
		<link>http://charlespatricknewman.com/blog/?p=336</link>
		<comments>http://charlespatricknewman.com/blog/?p=336#comments</comments>
		<pubDate>Thu, 24 Feb 2011 07:04:35 +0000</pubDate>
		<dc:creator>Charles Newman</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Adobe Flash Builder]]></category>
		<category><![CDATA[Adobe Flex]]></category>

		<guid isPermaLink="false">http://charlespatricknewman.com/blog/?p=336</guid>
		<description><![CDATA[There are a few blog posts out there on how to do this, but most of them involve a solution that requires a dummy reference in your Application code to the class you wish to instantiate, which forces the compiler to pull in the class, and therefore, allows getDefinition() to work.  But that solution defeats [...]]]></description>
			<content:encoded><![CDATA[<p>There are a few blog posts out there on how to do this, but most of them involve a solution that requires a dummy reference in your Application code to the class you wish to instantiate, which forces the compiler to pull in the class, and therefore, allows <code>getDefinition()</code> to work.  But that solution defeats the whole purpose of loading a SWF dynamically.</p>
<p>If you want to load a SWF remotely, and then instantiate a class within that SWF at run-time, you are in the right place.</p>
<p>In the example below, the &#8220;application&#8221; is <code>Foo</code> and the class we&#8217;ll instantiate will be called <code>Bar</code>.  Let&#8217;s look at the SWF containing <code>Bar</code> first. Our goal, is to load the SWF that contains <code>Bar</code> and instantiate <code>Bar</code> in our application.</p>
<h2>Dynamic.swf</h2>
<p>Below is the root level class of the SWF we&#8217;ll dynamically load, let&#8217;s say it&#8217;s called <code>Dynamic.swf</code>.  Notice the <code>private var</code> of type <code>Bar</code>. This is necessary to get the compiler to pull the <code>Bar</code> class into our <code>Dynamic.swf</code>.  The idea here, is we&#8217;ll build <code>Dynamic.swf</code> and put it up on a server somewhere, or localhost so we can test this.</p>
<pre>package
{
	import com.charlespatricknewman.sample.Bar;

	import flash.display.Sprite;

	public class Dynamic extends Sprite
	{
		// Need a dummy reference
		private var bar:Bar;

		public function Dynamic()
		{

		}
	}
}</pre>
<p>And here is the <code>Bar</code> class we want to instantiate in our Application at run-time:</p>
<pre>package com.charlespatricknewman.sample
{
	public class Bar
	{
		public function Bar()
		{
			trace("&gt;&gt;&gt; Bar() constructor!");
		}

		public function doSomething():void
		{
			trace("&gt;&gt;&gt; Bar.doSomething() called!");
		}
	}
}</pre>
<p>All this class does is trace out some text, but this is sufficient to prove this is working.</p>
<h2>The Application</h2>
<p>Next is <code>Foo</code>, the application that will load the SWF and instantiate <code>Bar</code>.  Note this project has no reference or dummy variables of type <code>Bar</code>.</p>
<p>Here is the root level class:</p>
<pre>package
{
import com.charlespatricknewman.sample.DynamicClassLoader;

import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;

public class Foo extends Sprite
{
	public function Foo()
	{
		this.addEventListener(Event.ADDED_TO_STAGE,
					onAddedToStage);
	}

	private function onAddedToStage(event:Event):void
	{
		go();
	}

	private function go():void
	{
		var loader:DynamicClassLoader = new DynamicClassLoader();
		setupListeners();
		loader.loadSWF("http://localhost/test/Dynamic.swf",
				"com.charlespatricknewman.sample.Bar");

		function setupListeners(add:Boolean=true):void
		{
			if (add)
			{
				loader.addEventListener(Event.COMPLETE,
					onClassLoaded);
			}
			else
			{
				loader.removeEventListener(Event.COMPLETE,
					onClassLoaded);
			}
		}

		function onClassLoaded(event:Event):void
		{
			setupListeners(false);
			var Bar:Class = loader.instantiateClass(
				"com.charlespatricknewman.sample.Bar");
			var bar:Object = new Bar();
			bar.doSomething();
		}
	}
}
}</pre>
<p>And here is the <code>DynamicClassLoader</code> class you see referenced above. This class could reside in the Application SWF or a library (SWC) the application uses at compile time.  It&#8217;s job is to load the SWF and allow the Application to instantiate a class in the loaded SWF.</p>
<pre>package com.charlespatricknewman.sample
{
 import flash.display.Loader;
 import flash.errors.IllegalOperationError;
 import flash.events.Event;
 import flash.net.URLRequest;
 import flash.system.ApplicationDomain;
 import flash.system.LoaderContext;

 public class DynamicClassLoader extends Loader
 {
	public function DynamicClassLoader()
	{
		super();
		contentLoaderInfo.addEventListener(Event.COMPLETE,
						onComplete);
	}

	public function loadSWF(swfPath:String, classPath:String):void
	{
		if (ApplicationDomain.currentDomain.hasDefinition(classPath))
		{
			throw new IllegalOperationError("Class is already loaded!");
		}

		var request:URLRequest = new URLRequest(swfPath);
		var context:LoaderContext = new LoaderContext();

		context.applicationDomain = ApplicationDomain.currentDomain;

		load(request, context);
	}

	public function instantiateClass(classPath:String):Class
	{
		return ApplicationDomain.currentDomain.getDefinition(classPath)
				as Class;
	}

	private function onComplete(event:Event):void
	{
		dispatchEvent(new Event(Event.COMPLETE));
	}
}
}</pre>
<p>Due to the security restrictions in the Flash Player, both <code>Dynamic.swf</code> and the Application SWF need to be loaded from either localhost or a web server.  You might also need a crossdomain.xml file on the web server, but it&#8217;s best to try this from localhost first so you can see it working.</p>
<p>This might be a good solution if you have a SWF or a SWC that contains a large amount of code that is rarely used.  Adding that code to your SWF or SWC might cause an unnecessarily large SWF.  But loading that bloated Class only when you need it, will provide a much faster initial download and startup for your end users.</p>
]]></content:encoded>
			<wfw:commentRss>http://charlespatricknewman.com/blog/?feed=rss2&#038;p=336</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building ActionScript 3 projects with Apache Ant</title>
		<link>http://charlespatricknewman.com/blog/?p=325</link>
		<comments>http://charlespatricknewman.com/blog/?p=325#comments</comments>
		<pubDate>Sat, 19 Feb 2011 22:49:46 +0000</pubDate>
		<dc:creator>Charles Newman</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[Apache Ant]]></category>
		<category><![CDATA[OSMF (Open Source Media Framework)]]></category>

		<guid isPermaLink="false">http://charlespatricknewman.com/blog/?p=325</guid>
		<description><![CDATA[There are several reasons to use Apache Ant to build your ActionScript and Adobe Flex projects: 1) If your team uses Continuos Integration. 2) Your project has lots of dependencies that have version branches of their own. 3) You don&#8217;t want to shell out the bucks for Flash Builder. 4) You want to quickly build [...]]]></description>
			<content:encoded><![CDATA[<p>There are several reasons to use <a href="http://ant.apache.org/">Apache Ant</a> to build your ActionScript and Adobe Flex projects:</p>
<p>1) If your team uses <a href="http://martinfowler.com/articles/continuousIntegration.html">Continuos Integration</a>.</p>
<p>2) Your project has lots of dependencies that have version branches of their own.</p>
<p>3) You don&#8217;t want to shell out the bucks for Flash Builder.</p>
<p>4) You want to quickly build a project without having to import the project into Flash Builder.</p>
<p>There are quite a few blog posts out there on how to do this, so I&#8217;ll keep this short and simple so you can get started.</p>
<p>To start, <a href="http://charlespatricknewman.com/flash/OSMFSimple.zip">download the zip file here</a>, I&#8217;ll discuss the contents of the zip below. If you are impatient or simply don&#8217;t like to read, open a Terminal window, change to the directory where you unzipped the file and type &#8220;ant&#8221;, and press Enter.  The script will build the project, create ASDocs, and then create a release zip file of the built project.</p>
<p>If you are on Windows, you&#8217;ll need to download and install <a href="http://ant.apache.org/">Apache Ant</a>.  You will also need the Flex SDK installed on your system, and the location of the SDK is specified in the &#8220;build.properties&#8221; file you will find in the zip.</p>
<h2>The Code</h2>
<p>Rather than use a &#8220;Hello World&#8221; app, we&#8217;ll start with an OSMF-based player that is as simple as it gets. This is the bare-bones code to play a video with the <a href="http://osmf.org">OSMF (Open Source Media Framework)</a>. You&#8217;ll find a ./src and a ./libs folder in the zip. The ./libs folder contains the OSMF.swc built for Flash Player 10.1. This is the same SWC file available at <a href="http://osmf.org">osmf.org</a>.</p>
<p>The ./src folder contains one ActionScript file, OSMFSimple.as:</p>
<pre>package
{
    import flash.display.Sprite;

    import org.osmf.elements.VideoElement;
    import org.osmf.media.MediaPlayerSprite;
    import org.osmf.net.StreamingURLResource;

    [SWF(backgroundColor="0x000000", frameRate="25", width="640", height="360")]

    /**
     * This is as simple as an OSMF-based media player can get.
     **/
    public class OSMFSimple extends Sprite
    {
	private static const MEDIA:String =
            "rtmp://cp67126.edgefcs.net/ondemand/mp4:mediapm/osmf/content/test/spacealonehd_sounas_640_700.mp4";

	private var mediaPlayerSprite:MediaPlayerSprite;

	public function OSMFSimple()
	{
		mediaPlayerSprite = new MediaPlayerSprite();
		addChild(mediaPlayerSprite);

		mediaPlayerSprite.media =
                   new VideoElement(new StreamingURLResource(MEDIA));
	}
    }
}</pre>
<h2>The Ant Build Script</h2>
<p>You will notice two files in the zip, &#8220;build.properties&#8221; and &#8220;build.xml&#8221;.</p>
<p>The build.properties file contains the settings that can be modified by developers to customize the build for their development environment.  The idea here is: developers can tweak this file for their dev environments without having to touch the build script.  This particular file contains only locale and the Flex SDK version location, but it could contain properties tied to environment variables, for example.</p>
<h3>build.properties</h3>
<pre>#SDKLocation:
FLEX_HOME=/Applications/Adobe Flash Builder 4/sdks/4.1.0
SDK_VERSION=4.1.0.16076
LOCALE=en_US</pre>
<h3>build.xml</h3>
<p>The build.xml file is the build script. <a href="http://charlespatricknewman.com/flash/OSMFSimple.zip">Download the zip file</a> and take a look at the build.xml file. You will see tasks for cleaning the bin-release folder, cleaning the deploy folder, cleaning the ASDocs folder, creating the HTML wrapper files, building the release, building the ASDocs, and creating the zip file.</p>
<p>Notice at the top of file, in the project tag you see default=&#8221;main&#8221;. This tells Ant to look for a task named &#8220;main&#8221;. Now look at the bottom of file and you&#8217;ll see the main task. This simply kicks off the tasks required to build a release of this project.</p>
<p>To run the script, simply open a Terminal window, change to the directory, type &#8220;ant&#8221; and hit enter. Because the default task is defined as &#8220;main&#8221;, no other arguments are required.</p>
<p>If you wanted to run a particular task, you could supply that on the command line, such as:</p>
<pre>ant release-build</pre>
<p>You don&#8217;t need to name your Ant script &#8220;build.xml&#8221;. If you don&#8217;t, you need to supply the filename on the command line like this:</p>
<pre>ant -f master-build.xml</pre>
<p>And then to specify a task within that build script:</p>
<pre>ant -f master-build.xml release-build</pre>
<p>Run the script by opening a Terminal window, change to the folder where you unzipped the file, and type &#8220;ant&#8221;, hit Enter.  You should see output similar to this:</p>
<pre>charles:OSMFSimple$ ant
Buildfile: /Users/charles/Downloads/OSMFSimple/build.xml

clean:
     [echo] cleaning...

clean-deploy:
     [echo] cleaning deploy folder...

clean-asdocs:
     [echo] cleaning asdocs...

release-build:
     [echo] building...
    [mxmlc] Loading configuration file /Applications/Adobe Flash Builder 4/sdks/4.1.0/frameworks/flex-config.xml
    [mxmlc] /Users/charles/Downloads/OSMFSimple/bin-release/OSMFSimple.swf (114460 bytes)

wrapper:

build-asdocs:
     [echo] building asdocs...
    [asdoc] Loading configuration file /Applications/Adobe Flash Builder 4/sdks/4.1.0/frameworks/flex-config.xml
    [asdoc] Documentation was created in /Users/charles/Downloads/OSMFSimple/docs/

zip-deploy:
      [zip] Building zip: /Users/charles/Downloads/OSMFSimple/deploy/OSMFSimple-release.zip

main:

BUILD SUCCESSFUL
Total time: 17 seconds</pre>
<p>If you were building a library (a SWC file) rather than a SWF, you would use the &lt;compc&gt; task rather than the &lt;mxmlc&gt; task.  For documentation on the Ant tasks supported by the Flex SDK <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=anttasks_1.html">see this page</a>.</p>
<p>There are many other things you can do with Ant, such as sync with your Perforce depot, deploy to an FTP server, etc.</p>
<p>The only thing I haven&#8217;t figure out how to do with Ant (yet) is duplicate the &#8220;include source&#8221; check box in Flash Builder when exporting a release build. This is handy when creating sample projects. If anyone has figured this out please post a comment here.</p>
<p>I hope this helps you get started with ActionScript and Ant. It has made life much easier for our development team.</p>
]]></content:encoded>
			<wfw:commentRss>http://charlespatricknewman.com/blog/?feed=rss2&#038;p=325</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Mac OS X &#8211; change a string in multiple files on the command line</title>
		<link>http://charlespatricknewman.com/blog/?p=321</link>
		<comments>http://charlespatricknewman.com/blog/?p=321#comments</comments>
		<pubDate>Thu, 13 Jan 2011 21:25:26 +0000</pubDate>
		<dc:creator>Charles Newman</dc:creator>
				<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://charlespatricknewman.com/blog/?p=321</guid>
		<description><![CDATA[Let&#8217;s say your team has been using the same license agreement in all source files for the entire year and during a code review someone happens to notice a misspelled word, or maybe the new year has arrived and you want to update the copyright notice.  You can ask the new intern to open all [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say your team has been using the same license agreement in all source files for the entire year and during a code review someone happens to notice a misspelled word, or maybe the new year has arrived and you want to update the copyright notice.  You can ask the new intern to open all 300 source files in your code repository and change each one, or even better, you can do it on the command line with a single line.</p>
<p>This command, typed into an OS X terminal will recursively change the misspelled word &#8216;auther&#8217; to &#8216;author&#8217; in every file with a &#8220;.as&#8221; extension in the current directory and below:</p>
<blockquote>
<div id="_mcePaste">find . -name &#8216;*.as&#8217; | xargs perl -pi -e &#8216;s/auther/author/g&#8217;</div>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://charlespatricknewman.com/blog/?feed=rss2&#038;p=321</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MinimalComps LineChart Example</title>
		<link>http://charlespatricknewman.com/blog/?p=309</link>
		<comments>http://charlespatricknewman.com/blog/?p=309#comments</comments>
		<pubDate>Sat, 08 Jan 2011 04:10:38 +0000</pubDate>
		<dc:creator>Charles Newman</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>

		<guid isPermaLink="false">http://charlespatricknewman.com/blog/?p=309</guid>
		<description><![CDATA[I&#8217;m working on a project that requires real-time charting. The Flex charting components are just way too CPU intensive for this project. So I needed a pure ActionScript 3 solution. I had heard of Minimal Comps by Bit-101 but had never checked it out before. This is a very cool and efficient set of pure [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on a project that requires real-time charting. The Flex charting components are just way too CPU intensive for this project. So I needed a pure ActionScript 3 solution. I had heard of <a href="http://www.minimalcomps.com/" target="_blank">Minimal Comps by Bit-101</a> but had never checked it out before. This is a very cool and efficient set of pure AS3 classes.</p>
<p>So far, I&#8217;m moving in the direction of extending the LineChart class and adding a LineSeries class so I can chart more than one series on the same chart, but I had a hard time finding any LineChart samples online so I&#8217;ll post this one I wrote to get familiar with the LineChart class in MinimalComps.</p>
<p>Right click anywhere in the sample to view source.  The sample charts a series of numbers from 0 to 100 once per second.  This type of chart would be useful for charting stock prices, bandwidth, or buffer length, for example.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="320" height="200" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://charlespatricknewman.com/flash/MinimalCompSample/MinimalCompsChartingSample.swf" /><embed type="application/x-shockwave-flash" width="320" height="200" src="http://charlespatricknewman.com/flash/MinimalCompSample/MinimalCompsChartingSample.swf"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://charlespatricknewman.com/blog/?feed=rss2&#038;p=309</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mac Ant Build &#8211; Error: PermGen space</title>
		<link>http://charlespatricknewman.com/blog/?p=305</link>
		<comments>http://charlespatricknewman.com/blog/?p=305#comments</comments>
		<pubDate>Tue, 14 Dec 2010 02:00:43 +0000</pubDate>
		<dc:creator>Charles Newman</dc:creator>
				<category><![CDATA[Adobe Flash Builder]]></category>
		<category><![CDATA[Apache Ant]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://charlespatricknewman.com/blog/?p=305</guid>
		<description><![CDATA[This is worthy of a post because it took me a while to figure it out. I created a fairly large Ant build script that kicks off builds for a project&#8217;s dependencies and it was working great until I added a few more things. It started failing with this: [compc] Loading configuration file /Applications/Adobe Flash [...]]]></description>
			<content:encoded><![CDATA[<p>This is worthy of a post because it took me a while to figure it out.</p>
<p>I created a fairly large Ant build script that kicks off builds for a project&#8217;s dependencies and it was working great until I added a few more things. It started failing with this:</p>
<blockquote><p>[compc] Loading configuration file /Applications/Adobe Flash Builder 4/sdks/4.1.0/frameworks/flex-config.xml<br />
[compc] Error: PermGen space</p></blockquote>
<p>I&#8217;m not a hard core Java guy but I figured this had something to do with the Java Virtual Machine running out of memory. So after digging a bit and trying a few different things the solution I came up with was this:</p>
<blockquote><p>export ANT_OPTS=-XX:MaxPermSize=512m</p></blockquote>
<p>Try it on the command line first. If that works for you, you might want to add it to your .bash_profile. Once I added that, my build script was able to complete.</p>
]]></content:encoded>
			<wfw:commentRss>http://charlespatricknewman.com/blog/?feed=rss2&#038;p=305</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>OSMF &#8211; Release 1.5 is now available</title>
		<link>http://charlespatricknewman.com/blog/?p=300</link>
		<comments>http://charlespatricknewman.com/blog/?p=300#comments</comments>
		<pubDate>Mon, 08 Nov 2010 18:23:42 +0000</pubDate>
		<dc:creator>Charles Newman</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[OSMF (Open Source Media Framework)]]></category>

		<guid isPermaLink="false">http://charlespatricknewman.com/blog/?p=300</guid>
		<description><![CDATA[This release includes lots of bug fixes plus support for FMS 4.0 Multicast and FMS 3.5.3 Stream Reconnect. The stream reconnect logic will try to reconnect you to the FMS server if you switch from wired to wireless, for example. If the reconnect happens before the buffer empties, you get a seemless experience. If the [...]]]></description>
			<content:encoded><![CDATA[<p>This release includes lots of bug fixes plus support for FMS 4.0 Multicast and FMS 3.5.3 Stream Reconnect. The stream reconnect logic will try to reconnect you to the FMS server if you switch from wired to wireless, for example. If the reconnect happens before the buffer empties, you get a seemless experience. If the buffer does empty, it will try for 2 minutes to reconnect and if successful, it will start right where it left off. Both of these new features require Flash Player 10.1.</p>
<p>You can get the new release at <a href="http://osmf.org" target="_blank">osmf.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://charlespatricknewman.com/blog/?feed=rss2&#038;p=300</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Flash Builder/Flex Builder &#8211; No Support for Relative Paths</title>
		<link>http://charlespatricknewman.com/blog/?p=278</link>
		<comments>http://charlespatricknewman.com/blog/?p=278#comments</comments>
		<pubDate>Thu, 09 Sep 2010 00:46:22 +0000</pubDate>
		<dc:creator>Charles Newman</dc:creator>
				<category><![CDATA[Adobe Flash Builder]]></category>
		<category><![CDATA[Adobe Flex]]></category>

		<guid isPermaLink="false">http://charlespatricknewman.com/blog/?p=278</guid>
		<description><![CDATA[You can&#8217;t enter a relative source path in Flex/Flash builder. For example, if I want the Flash authoring environment to find a class or classes on my system, I can tell it to look here: &#8220;../../libs&#8221; and it will go up 2 directories, go to libs and look in every directory under that until it [...]]]></description>
			<content:encoded><![CDATA[<p>You can&#8217;t enter a relative source path in Flex/Flash builder. For example, if I want the Flash authoring environment to find a class or classes on my system, I can tell it to look here: &#8220;../../libs&#8221; and it will go up 2 directories, go to libs and look in every directory under that until it finds the class. This allows me to check-in the FLA file and everyone on the team is going to be able to build it.</p>
<p>However, Flex/Flash Builder is built on Eclipse, and from what I&#8217;ve been a able to gather, relative paths are not accepted for source paths, which is a real pain. Unless everyone on your team stores code under &#8220;${DOCUMENTS}/everyone/uses/the/same/dev/path&#8221;, which in that case you could use the built in Linked Resources that Builder defines. But if you work on a framework or a public API, or just a dev team where people want choice over where they place their source code, this sucks.</p>
<p>I complained to one of the guys on the Builder team at Adobe about this and he told me this was a limitation of Eclipse and there is nothing they can do about it. But, he gave me a nice workaround and it occurred to me today, while showing this trick to a co-worker, that I should post this because others may not know about it.</p>
<h3>Here&#8217;s the problem:</h3>
<p>You create a new project in Flex/Flash builder and you want to reference the classes in another project. If that other project is a library, and you don&#8217;t want to reference the SWC, but the actual project source, you can simply hit &#8220;Add Project&#8230;&#8221; and select the project from the window that pops up and you are good to go, no relative paths required, Builder knows where everything is:</p>
<p><a href="http://charlespatricknewman.com/blog/wp-content/uploads/2010/09/flash-builder-props-lib.png"><img class="alignleft size-full wp-image-279" title="flash-builder-props-lib" src="http://charlespatricknewman.com/blog/wp-content/uploads/2010/09/flash-builder-props-lib.png" alt="" width="847" height="522" /></a></p>
<p>However, if you want to reference another project that is not a library project, such as an OSMF plugin (a project that creates a SWF, not a SWC), you need to use the &#8220;Source path&#8221; tab on this dialog and click the &#8220;Add Folder&#8230;&#8221; button:</p>
<h3><a href="http://charlespatricknewman.com/blog/wp-content/uploads/2010/09/flash-builder-props-source-path.png"><img class="alignleft size-full wp-image-280" title="flash-builder-props-source-path" src="http://charlespatricknewman.com/blog/wp-content/uploads/2010/09/flash-builder-props-source-path.png" alt="" width="847" height="522" /></a><br />
<strong>Here&#8217;s the trick:</strong></h3>
<blockquote><p>Don&#8217;t use the Browse button on the window that pops-up when you click &#8220;Add Folder&#8230;&#8221; above. Just type a slash (&#8216;/&#8217;) followed by the project name.</p></blockquote>
<p>Of course the project needs to be present in Builder (i.e., you either created it in Builder or imported it into Builder). The problem occurs when you use the browse button to locate the project because the entire path, which is specific to your system, will show up in the project files and no one except you is going to be able to build the project.  But if you just type a slash followed by the project name, builder will find the project and everyone will be able to build it.</p>
<p>In the image just above is what you should see on this tab, not the full path to the projects.</p>
<p>And your .actionScriptProperties file will have entries like this:</p>
<blockquote><p>&lt;compilerSourcePath&gt;</p>
<p>&lt;compilerSourcePathEntry kind=&#8221;1&#8243; linkType=&#8221;1&#8243; <strong>path=&#8221;/AkamaiAdvancedStreamingPlugin&#8221;/</strong>&gt;</p>
<p>&lt;compilerSourcePathEntry kind=&#8221;1&#8243; linkType=&#8221;1&#8243; <strong>path=&#8221;/AkamaiBasicStreamingPlugin&#8221;/</strong>&gt;</p>
<p>&lt;/compilerSourcePath&gt;</p></blockquote>
<div>Notice the full path is not there.</div>
</p>
<h3>One more thing:</h3>
<div>You need to do one more thing before checking your code into a repository (SVN, Perforce, etc.):</div>
<div>Check your <em>.projec</em>t file and delete the <em>&lt;linkedResources&gt;</em> tag:</div>
<blockquote>
<div>
<div id="_mcePaste">&lt;linkedResources&gt;</div>
<div id="_mcePaste">&lt;link&gt;</div>
<div id="_mcePaste">&lt;name&gt;[source path] AkamaiAdvancedStreamingPlugin&lt;/name&gt;</div>
<div id="_mcePaste">&lt;type&gt;2&lt;/type&gt;</div>
<div id="_mcePaste">&lt;location&gt;/Users/cnewman/Documents/Akamai/p4/projects/flash-client-dev/osmf/plugins/advanced-streaming-    plugin/trunk/AkamaiAdvancedStreamingPlugin&lt;/location&gt;</div>
<div id="_mcePaste">&lt;/link&gt;</div>
<div>&lt;/linkedResources&gt;</div>
</div>
</blockquote>
<div id="_mcePaste">Notice the full system path is in there. Builder doesn&#8217;t need this tag to build your project, it&#8217;s only for the Eclipse GUI, so just remove it from the file so no one gets errors importing your project.</div>
</p>
<div>I realize there are Linked Resources at the General-&gt;Workspace level for builder such as ${DOCUMENTS}. But this is not a great solution if you work on a project that a lot of people are going to need to be able to build, such as a public framework or API.  Everyone who wants to build your project is going to need to setup your required Linked Resource before they can build. But with the trick above, all they need to do is import your Builder project and go.</div>
]]></content:encoded>
			<wfw:commentRss>http://charlespatricknewman.com/blog/?feed=rss2&#038;p=278</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Flex Builder/Flash Builder &#8211; Switch Perspectives Quickly</title>
		<link>http://charlespatricknewman.com/blog/?p=272</link>
		<comments>http://charlespatricknewman.com/blog/?p=272#comments</comments>
		<pubDate>Thu, 24 Jun 2010 00:56:54 +0000</pubDate>
		<dc:creator>Charles Newman</dc:creator>
				<category><![CDATA[Adobe Flash Builder]]></category>
		<category><![CDATA[Adobe Flex]]></category>

		<guid isPermaLink="false">http://charlespatricknewman.com/blog/?p=272</guid>
		<description><![CDATA[I just discovered this by accidentally hitting the wrong key while debugging: To switch from Debug Perspective back to Development Perspective, hit Cmd+F8. Flex Builder pops up a list of Perspectives, hit Cmd+F8 again to cycle through your list.  This is very handy when you&#8217;re finished debugging and want to quickly get back to the [...]]]></description>
			<content:encoded><![CDATA[<p>I just discovered this by accidentally hitting the wrong key while debugging:</p>
<p>To switch from <strong><em>Debug Perspective</em></strong> back to <strong><em>Development Perspective</em></strong>, hit <strong>Cmd+F8</strong>.</p>
<p>Flex Builder pops up a list of <em><strong>Perspectives</strong></em>, hit <strong>Cmd+F8</strong> again to cycle through your list.  This is very handy when you&#8217;re finished debugging and want to quickly get back to the <em><strong>Development Perspective</strong></em> without reaching for the mouse.  I occasionally stumble on these kinds of things I should already know&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://charlespatricknewman.com/blog/?feed=rss2&#038;p=272</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

