<?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/"
	>

<channel>
	<title>mikemo</title>
	<atom:link href="http://www.morearty.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.morearty.com/blog</link>
	<description>Mike Morearty, a developer on the Flex Builder team.</description>
	<pubDate>Mon, 18 May 2009 21:54:27 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Flex Builder tip: How to dismiss the &#8220;Add Watch Expression&#8221; dialog from the keyboard</title>
		<link>http://www.morearty.com/blog/2009/05/18/flex-builder-tip-how-to-dismiss-the-add-watch-expression-dialog-from-the-keyboard/</link>
		<comments>http://www.morearty.com/blog/2009/05/18/flex-builder-tip-how-to-dismiss-the-add-watch-expression-dialog-from-the-keyboard/#comments</comments>
		<pubDate>Mon, 18 May 2009 21:54:27 +0000</pubDate>
		<dc:creator>mike</dc:creator>
		
		<category><![CDATA[Adobe]]></category>

		<category><![CDATA[Flash/Flex/Flex Builder]]></category>

		<guid isPermaLink="false">http://www.morearty.com/blog/?p=218</guid>
		<description><![CDATA[One of the most common Flex Builder debugger complaints is that when you bring up the dialog to add a new expression to the Expressions view (e.g. via right-click > Add Watch Expression), you cannot dismiss this dialog using the keyboard alone.  The dialog has a multi-line edit box, and if you press Return, [...]]]></description>
			<content:encoded><![CDATA[<p>One <img align="right" src="http://www.morearty.com/blog/wp-content/uploads/2009/05/add-watch-expression-300x198.png" alt="add-watch-expression" title="add-watch-expression" width="300" height="198" class="alignnone size-medium wp-image-221" />of the most common Flex Builder debugger complaints is that when you bring up the dialog to add a new expression to the Expressions view (e.g. via right-click > Add Watch Expression), you cannot dismiss this dialog using the keyboard alone.  The dialog has a multi-line edit box, and if you press Return, that just adds a carriage return to the edit box. Similarly, trying to tab out of the edit box doesn&#8217;t work &#8212; it just inserts a tab character into the edit box.</p>
<p>This drives keyboard-heavy users (like me) crazy.  However, it turns out that there <em>is</em> a way to dismiss this dialog from the key:</p>
<p><strong>Type Shift+Return instead of Return.</strong></p>
<p>There is, in fact, a good reason why this dialog has a multi-line edit box.  As explained in this <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=271411">Eclipse bug</a>, some languages (including Java) allow you to enter more than just a simple expression into this box.  And since the dialog comes from Eclipse&#8217;s code rather than from Flex Builder&#8217;s, we can&#8217;t just change it to have a single line.</p>
<p>Since this is such a common point of frustration for Flex Builder users, in the above-linked bug I have asked that they find some way to make this easier for people to deal with, e.g. by perhaps having a short message in the dialog mentioning Shift+Return.  But in any case, you now know the secret handshake &#8212; enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.morearty.com/blog/2009/05/18/flex-builder-tip-how-to-dismiss-the-add-watch-expression-dialog-from-the-keyboard/feed/</wfw:commentRss>
		</item>
		<item>
		<title>AprilScript: ActionScript worst practices</title>
		<link>http://www.morearty.com/blog/2009/04/01/aprilscript-actionscript-worst-practices/</link>
		<comments>http://www.morearty.com/blog/2009/04/01/aprilscript-actionscript-worst-practices/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 18:05:04 +0000</pubDate>
		<dc:creator>mike</dc:creator>
		
		<category><![CDATA[Flash/Flex/Flex Builder]]></category>

		<guid isPermaLink="false">http://www.morearty.com/blog/?p=202</guid>
		<description><![CDATA[In honor of the date, and in the spirit of the old Obfuscated C Code Contest, I&#8217;ve written a bit of code to demonstrate some of the more, shall we say, interesting things you can do with ActionScript.
The code:
package {
    import flash.display.*
    import flash.text.*

    public class [...]]]></description>
			<content:encoded><![CDATA[<p>In honor of the date, and in the spirit of the old Obfuscated C Code Contest, I&#8217;ve written a bit of code to demonstrate some of the more, shall we say, <em>interesting</em> things you can do with ActionScript.</p>
<p>The code:</p>
<pre>package {
    import flash.display.*
    import flash.text.*

    public class AprilFools extends Sprite {
        エイプリルフール var Number = 4..toString()

        use namespace エイプリルフール

        function AprilFools()
        {
            get = set
            set = get

            with (createTextField())
                text = new Date(Number).toDateString()
        }

        function get get() { return Number + <><{Number}
            b={"/"+Number.split(/\//)[0]*502.25}/>&lt;/>..@b }
        function set get(set) { Number = set+'/'+set/4 }

        function get set() { return Number }
        function set set(get) { Number = get }

        // nothing fun here
        function createTextField():TextField
        {
            stage.scaleMode = StageScaleMode.NO_SCALE;
            stage.align = StageAlign.TOP_LEFT;
            var textField:TextField = new TextField();
            textField.width = 1000;
            addChild(textField);
            return textField;
        }
    }
}

namespace エイプリルフール
</pre>
<p>The program&#8217;s weak spot is creativity in terms of what it actually does &#8212; just some static text output.  Pretty pathetic really.  All my effort went into the ActionScript.  <a href="/blog/wp-content/uploads/2009/04/aprilfools.swf">Click here</a> to see the result.  It&#8217;s probably not worth the effort to try to figure out what it does before running it; that&#8217;s not really the fun part.  The fun part is trying to figure out why the heck the thing compiles at all; what the individual lines of code actually mean; and what sick features of the language I am taking advantage of.  Tell me what you find.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.morearty.com/blog/2009/04/01/aprilscript-actionscript-worst-practices/feed/</wfw:commentRss>
		</item>
		<item>
		<title>All Flex developers, please do this.</title>
		<link>http://www.morearty.com/blog/2009/03/06/all-flex-developers-please-do-this/</link>
		<comments>http://www.morearty.com/blog/2009/03/06/all-flex-developers-please-do-this/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 18:19:29 +0000</pubDate>
		<dc:creator>mike</dc:creator>
		
		<category><![CDATA[Flash/Flex/Flex Builder]]></category>

		<guid isPermaLink="false">http://www.morearty.com/blog/?p=196</guid>
		<description><![CDATA[Even if you aren&#8217;t a Mac user, please do this to your Flex apps.
Even if you aren&#8217;t the kind of person who uses the scroll wheel on your mouse or two-finger scroll on your trackpad, please do it.
If you do, you will make some of your users very very happy.
]]></description>
			<content:encoded><![CDATA[<p>Even if you aren&#8217;t a Mac user, please <a href="http://blog.pixelbreaker.com/flash/as30-mousewheel-on-mac-os-x/">do this</a> to your Flex apps.</p>
<p>Even if you aren&#8217;t the kind of person who uses the scroll wheel on your mouse or two-finger scroll on your trackpad, please do it.</p>
<p>If you do, you will make some of your users very very happy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.morearty.com/blog/2009/03/06/all-flex-developers-please-do-this/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to capture the compilation options used by Flex Builder</title>
		<link>http://www.morearty.com/blog/2009/01/23/how-to-capture-the-compilation-options-used-by-flex-builder/</link>
		<comments>http://www.morearty.com/blog/2009/01/23/how-to-capture-the-compilation-options-used-by-flex-builder/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 19:10:48 +0000</pubDate>
		<dc:creator>mike</dc:creator>
		
		<category><![CDATA[Flash/Flex/Flex Builder]]></category>

		<guid isPermaLink="false">http://www.morearty.com/blog/?p=186</guid>
		<description><![CDATA[Suppose you are trying to set up a nightly build system &#8212; your developers use Flex Builder during the day, and you are creating an Ant task that runs every night. And you want the Ant task to use exactly the same build settings that are used by the developers.
mxmlc and compc have a -dump-config [...]]]></description>
			<content:encoded><![CDATA[<p>Suppose you are trying to set up a nightly build system &#8212; your developers use Flex Builder during the day, and you are creating an Ant task that runs every night. And you want the Ant task to use exactly the same build settings that are used by the developers.</p>
<p><code>mxmlc</code> and <code>compc</code> have a <code>-dump-config</code> option to dump all settings to a file. Later, the settings in that file can be read back in with <code>-load-config</code>.</p>
<p>So, do this:</p>
<ul>
<li>In Flex Builder, do Project Properties</li>
<li>Click the &#8220;Flex Compiler&#8221; tab</li>
<li>In the &#8220;Additional compiler arguments&#8221; box, add &#8220;-dump-config <em>full-path-to-output-file</em>&#8220;. For example, on Windows, &#8220;-dump-config C:\myconfig.xml&#8221;; on Mac, &#8220;-dump-config /Users/<em>myname</em>/myconfig.xml&#8221;. (If you use a relative path, the file will be put in some odd hard-to-find place.)</li>
<li>Click OK.  If Build Automatically is on, just clicking OK will cause the file to be built; if it is off, do a build now.</li>
<li>Now that the settings have been dumped, go back to your project settings and remove the <code>-dump-config</code> option.</li>
<li>Tweak the settings file as necessary (one thing you will almost certainly want to do is change <code>&lt;debug&gt;true&lt;/debug&gt;</code> to <code>&lt;debug&gt;false&lt;/debug&gt;</code> if your nightly build is supposed to do a release build), and use it in your nightly build script.</li>
</ul>
<p>Please be aware that this only captures compiler settings; it doesn&#8217;t capture all the other little things that Flex Builder does for you, like compiling Flex library projects that your project depends on, copying non-embedded assets to the output directory, optimizing modules for the application, extracting RSLs, copying the HTML template, and so on.</p>
<p>More info <a href="http://kb.adobe.com/selfservice/viewContent.do?externalId=kb404341">here</a>. Please read that, it has additional info you will probably need.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.morearty.com/blog/2009/01/23/how-to-capture-the-compilation-options-used-by-flex-builder/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fun with the iPhone spell checker</title>
		<link>http://www.morearty.com/blog/2009/01/05/fun-with-the-iphone-spell-checker/</link>
		<comments>http://www.morearty.com/blog/2009/01/05/fun-with-the-iphone-spell-checker/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 01:15:23 +0000</pubDate>
		<dc:creator>mike</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.morearty.com/blog/?p=184</guid>
		<description><![CDATA[Going skiing next month. So I started typing some info into the calendar in my iPhone.
I typed Donner, as in Donner Pass.  The iPhone &#8220;corrected&#8221; that to Dinner.
Um, yeah, that&#8217;s appropriate.
(I&#8217;m also sick of the iPhone changing its to it&#8217;s.  Its spell checker doesn&#8217;t know what it&#8217;s doing!)
Any other funny ones?
]]></description>
			<content:encoded><![CDATA[<p>Going skiing next month. So I started typing some info into the calendar in my iPhone.</p>
<p>I typed <em>Donner,</em> as in Donner Pass.  The iPhone &#8220;corrected&#8221; that to <em>Dinner</em>.</p>
<p>Um, yeah, <a href="http://en.wikipedia.org/wiki/Donner_Party">that&#8217;s appropriate</a>.</p>
<p>(I&#8217;m also sick of the iPhone changing <em>its</em> to <em>it&#8217;s</em>.  Its spell checker doesn&#8217;t know what it&#8217;s doing!)</p>
<p>Any other funny ones?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.morearty.com/blog/2009/01/05/fun-with-the-iphone-spell-checker/feed/</wfw:commentRss>
		</item>
		<item>
		<title>UI race conditions</title>
		<link>http://www.morearty.com/blog/2008/12/21/ui-race-conditions/</link>
		<comments>http://www.morearty.com/blog/2008/12/21/ui-race-conditions/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 06:54:02 +0000</pubDate>
		<dc:creator>mike</dc:creator>
		
		<category><![CDATA[Flash/Flex/Flex Builder]]></category>

		<guid isPermaLink="false">http://www.morearty.com/blog/?p=176</guid>
		<description><![CDATA[I&#8217;m sure this has happened to you once in a while: You&#8217;re doing several things at the same time on the computer, e.g. perhaps you click to launch some slow program, and while that is launching you go over to your web browser to kill a few seconds reading something.  You try to click a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sure this has happened to you once in a while: You&#8217;re doing several things at the same time on the computer, e.g. perhaps you click to launch some slow program, and while that is launching you go over to your web browser to kill a few seconds reading something.  You try to click a link, but <em>oops</em> &#8211; just when you were about to click it, the other program finishes loading, and you have accidentally clicked something in it.</p>
<p>A variation of that happened to me just today.  I decided to try Yahoo Chess (and I&#8217;m proud to say I won my game).  You enter a room, e.g. the beginner room, and then there is a list of tables; you click to join a particular table.  But every few seconds, the list of tables keeps refreshing, so the button you were about to click could have suddenly disappeared &#8212; or worse, turned into a button for a different table you didn&#8217;t intend to join.</p>
<p>What&#8217;s interesting to me (I don&#8217;t know why, maybe because I&#8217;m a geek) is that this is a real-life version (if using the computer is considered real life) of the sort of race condition horribleness we all run into when we write multithreaded code. Thread 1 tries to increment a variable, but <em>oops</em>, thread 2 sneaks in there and changes it!  Urgh.</p>
<p>Does this ever come up in <em>real</em> real life (as opposed to real life while using a computer)?  Yes, of course &#8212; one good example is the awkward little dance we all do once in a while when trying to walk past someone else who is coming the other way. Both step to the right, oops, both step to the left, oops!</p>
<p>In the case of computer UI, I can think of two ways to alleviate this problem (I am not claiming any incredible insight here, I think these are pretty obvious):</p>
<ol>
<li>Animation can help. E.g. in the example of the Yahoo Chess list of tables, when the list redraws, rather than having it redraw instantly as it does now, maybe the individual rows of the list should slide to their new positions.  That gives a person&#8217;s eye the visual feedback, &#8220;Wait, don&#8217;t click just now.&#8221;  Animation is sort of the computer equivalent of what usually helps avoid this problem in real-life scenarios: Most of the time, the fact that you can see the other person moving and adapt to their movement gives your brain enough time to avoid a collision.</li>
<li>Maybe disable the mouse (and keyboard if appropriate) for a fraction of a second, e.g. maybe 1/4 second, immediately after a change, e.g. immediately after the list of chess tables was updated, or immediately after a program opens a new window or dialog.</li>
</ol>
<p>Of course, it would often be appropriate to combine both of those techniques: disable the mouse, do the animation, and then re-enable the mouse.  If done that way, the mouse could be immediately re-enabled when the animation was done &#8212; no need to wait for 1/4 second more after the animation is done, because the person has already had sufficient time to process what is happening and avoid an accidental click.</p>
<p>What do you think?  I&#8217;m sure none of this is terribly original &#8212; I imagine lots of research on this topic has been done.  I just haven&#8217;t come across it.  (Sometimes blogging scares me, because the Internet is so huge that no matter how original a particular thought of mine might be, the odds are extremely good that someone else has already had it, and has said it on the Internet, and thus it&#8217;s already in the Google index, and so should I really bother.  Reminds me of a joke that A. Whitney Brown made many many years ago in Saturday Night Live: &#8220;There are a billion people in China.  Think about that.  That means if you&#8217;re a one-in-a-million kind of guy, there are a thousand other people exactly like you.&#8221;)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.morearty.com/blog/2008/12/21/ui-race-conditions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Extending Flex Builder: sample code for design.xml</title>
		<link>http://www.morearty.com/blog/2008/11/19/extending-flex-builder-sample-code-for-designxml/</link>
		<comments>http://www.morearty.com/blog/2008/11/19/extending-flex-builder-sample-code-for-designxml/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 06:46:13 +0000</pubDate>
		<dc:creator>mike</dc:creator>
		
		<category><![CDATA[Adobe]]></category>

		<category><![CDATA[Flash/Flex/Flex Builder]]></category>

		<guid isPermaLink="false">http://www.morearty.com/blog/?p=173</guid>
		<description><![CDATA[Thanks to everyone who came to David&#8217;s and my talk at MAX today, Extending Flex Builder.  I promised to post the sample code for the part of the talk which discussed design.xml.
So here it is.  This ZIP file contains two projects:

 MyLibrary is the main interesting part.  It contains design.xml, a Flex [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to everyone who came to <a href="http://davidzuckerman.com/adobe/">David</a>&#8217;s and my talk at MAX today, <a href="http://davidzuckerman.com/adobe/max-2008-extending-flex-builder-presentation/">Extending Flex Builder</a>.  I promised to post the sample code for the part of the talk which discussed design.xml.</p>
<p>So <a href='http://www.morearty.com/blog/wp-content/uploads/2008/11/max2008.zip'>here it is</a>.  This ZIP file contains two projects:</p>
<ul>
<li> <b>MyLibrary</b> is the main interesting part.  It contains <tt>design.xml</tt>, a Flex manifest, and a sample component.  See the slides (linked above) for an explanation of how all this stuff hooks together. </li>
<li> <b>MyFlexProject</b> is just a simple Flex Project that has <b>MyLibrary</b> on its library path, so that you can see that when you open the Flex project&#8217;s main app in design view, the library&#8217;s Calculator component shows up in the &#8220;Mike&#8217;s stuff&#8221; folder of the Components view (as opposed to the default, the &#8220;Custom&#8221; folder), and that if you click on the calculator that is already in the document, the list of properties in the Properties view has been customized, with the &#8220;Layout:&#8221; property showing up there.
</ul>
<p>To reiterate, the sample by itself isn&#8217;t quite enough &#8212; you really need to see the slides (starting at slide #23) to understand the context.  And, I will soon be writing an Adobe Developer Center article with much more detail.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.morearty.com/blog/2008/11/19/extending-flex-builder-sample-code-for-designxml/feed/</wfw:commentRss>
		</item>
		<item>
		<title>News about tomorrow&#8217;s &#8220;Extending Flex Builder&#8221; talk</title>
		<link>http://www.morearty.com/blog/2008/11/18/news-about-tomorrows-extending-flex-builder-talk/</link>
		<comments>http://www.morearty.com/blog/2008/11/18/news-about-tomorrows-extending-flex-builder-talk/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 02:12:46 +0000</pubDate>
		<dc:creator>mike</dc:creator>
		
		<category><![CDATA[Adobe]]></category>

		<category><![CDATA[Flash/Flex/Flex Builder]]></category>

		<guid isPermaLink="false">http://www.morearty.com/blog/?p=170</guid>
		<description><![CDATA[There are two things I wanted to mention about the talk David and I are doing tomorrow, &#8220;Extending Flex Builder&#8221; &#8212; David already mentioned this on his blog, but in case you missed it, the documentation team has posted the docs for Flex Builder&#8217;s  Code Model API and Design Model API up on adobe.com. [...]]]></description>
			<content:encoded><![CDATA[<p>There are two things I wanted to mention about the talk <a href="http://davidzuckerman.com/adobe/">David</a> and I are doing tomorrow, &#8220;Extending Flex Builder&#8221; &#8212; David already mentioned this on his blog, but in case you missed it, the documentation team has posted the docs for Flex Builder&#8217;s  <a href="http://www.adobe.com/livedocs/flex/3/extensibility/">Code Model API and Design Model API</a> up on adobe.com.  Previously, the only way to find this documentation was by running Flex Builder and then going to the help &#8212; but as you all know, if Google can&#8217;t find it, it doesn&#8217;t exist.  So, thanks, doc team!</p>
<p>Also, David posted the sample code for tomorrow&#8217;s talk.  See his post <a href="http://davidzuckerman.com/adobe/2008/11/18/max-2008-sample-content-for-extending-flex-builder/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.morearty.com/blog/2008/11/18/news-about-tomorrows-extending-flex-builder-talk/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New Flex Builder debugger features: Conditional breakpoints, function calls from expressions, watchpoints, and more</title>
		<link>http://www.morearty.com/blog/2008/11/18/new-flex-builder-debugger-features-conditional-breakpoints-function-calls-from-expressions-watchpoints-and-more/</link>
		<comments>http://www.morearty.com/blog/2008/11/18/new-flex-builder-debugger-features-conditional-breakpoints-function-calls-from-expressions-watchpoints-and-more/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 09:41:45 +0000</pubDate>
		<dc:creator>mike</dc:creator>
		
		<category><![CDATA[Adobe]]></category>

		<category><![CDATA[Flash/Flex/Flex Builder]]></category>

		<guid isPermaLink="false">http://www.morearty.com/blog/?p=162</guid>
		<description><![CDATA[I wanted to tell you all about some of the exciting debugger features we've been working on, which will be in Flex Builder 4, including several of the most common requests.  All of the features listed below are in the preview release of Flex Builder that we gave out at MAX, with the, um, [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to tell you all about some of the exciting debugger features we've been working on, which will be in Flex Builder 4, including several of the most common requests.  All of the features listed below are in the preview release of Flex Builder that we gave out at MAX, with the, um, exception of exception breakpoints, which are not yet in the product.  If you were at MAX, give these features a try, and let us know your feedback!  If you weren't able to make it to MAX, don't worry, this stuff will eventually show up in a beta on Adobe Labs, and then of course in the final product as well.</p>
<h3>Conditional breakpoints</h3>
<p>Suppose you have set a breakpoint, but that line of code is reached hundreds of times, and you only care about the case where a variable 'x' is unexpectedly equal to null.  Just right-click on the breakpoint, go to its properties, and add the condition:</p>
<p><img src="http://www.morearty.com/blog/wp-content/uploads/2008/11/conditional-breakpoint1.png" alt="" title="conditional-breakpoint1" width="400" height="352" class="alignnone size-full wp-image-164" /></p>
<p>For some extra breakpointy goodness, you can also set a hit count on any breakpoint -- e.g. a hit count of 5 means, don't halt until the fifth time that line of code is reached.</p>
<h3>Awesome new expression evaluator: function calls, E4X, regular expressions, etc.</h3>
<p>Going along with conditional breakpoints is a vastly improved expression evaluator.  It is used when evaluating conditional breakpoints, in the Expressions view, and in debugger tooltips.</p>
<p>For one thing, you can now make function calls directly from the Expressions view (as well as from conditional breakpoints):</p>
<div class="syntax_hilite">
<div id="code-6">
<pre class="code">mystr.<span style="">indexOf</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"test"</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre>
</div>
</div>
<p></p>
<p>Also, regular expressions and E4X expressions can be quite tricky to debug; with the new expression evaluator, you can just type them into the Expressions view and immediately see the value.  (The one exception is you can't use E4X filter expressions such as "myxmlvar.(@id=='3')".)  For example, suppose "customers" is an XML object -- you can do expressions like these in the Expressions view:</p>
<div class="syntax_hilite">
<div id="code-7">
<pre class="code">myCustomersXML.<span style="">customer</span>.@name
myCustomersXML..<span style="">zipCode</span>
myCustomersXML.<span style="">customer</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>.@name</pre>
</div>
</div>
<p></p>
<p>Here is a regular-expression example that you could put in the Expressions view or a breakpoint condition:</p>
<div class="syntax_hilite">
<div id="code-8">
<pre class="code">mystr.<span style="">match</span><span style="color:#006600; font-weight:bold;">&#40;</span> /<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;">0</span>-<span style="color:#800000;">9</span><span style="color:#006600; font-weight:bold;">&#93;</span>+/ig <span style="color:#006600; font-weight:bold;">&#41;</span></pre>
</div>
</div>
<p></p>
<p>You can use the ternary ( ?: ) operator:</p>
<div class="syntax_hilite">
<div id="code-9">
<pre class="code">mystr.<span style="">length</span>&gt;=<span style="color:#800000;">3</span> ? mystr.<span style="">charAt</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span> : <span style="color:#CC0000;">"too short"</span></pre>
</div>
</div>
<p></p>
<p>You can use the "is" operator (this is especially useful in conditional breakpoints):</p>
<div class="syntax_hilite">
<div id="code-10">
<pre class="code">obj is String</pre>
</div>
</div>
<p></p>
<p>The possibilities are limitless.  <code>===</code>, <code>!==</code>, string concatenation, etc. -- almost any other ActionScript expression you can think of, you can put it in the Expressions view or a breakpoint condition.</p>
<h3>Watchpoints</h3>
<p>Watchpoints tell the debugger to immediately halt when the value of a particular variable changes.  Suppose you have a variable whose value keeps changing out from under you, and you can't figure out who is changing it.  With a watchpoint, it's trivial -- just set the watchpoint and run your code.  (Flex Builder watchpoints are set on a particular <i>instance</i> of a variable.  For example, you set a watchpoint on the _width field of a button "myButton", not on the _width field of all Buttons.)</p>
<p><img src="http://www.morearty.com/blog/wp-content/uploads/2008/11/toggle-watchpoint.png" alt="" title="toggle-watchpoint" width="400" height="222" class="alignnone size-full wp-image-165" /></p>
<h3>Exception breakpoints</h3>
<p>The debugger always halts immediately whenever there is an uncaught exception.  But sometimes, you want the debugger to halt even on an exception that <i>is</i> going to be caught by a <code>try/catch</code> block in your code.</p>
<p>That's what exception breakpoints will let you do.  You will be able to say, for example, "Always halt in the debugger whenever a <code>TypeError</code> is thrown, even if it is going to be caught."</p>
<h3>Run to line</h3>
<p>A minor feature but still quite nice to have: Run to Line (Cmd+R on Mac, Ctrl+R on Windows) is a quick way to set a temporary breakpoint on the current line, then run until you get there, and then automatically clear the temporary breakpoint.</p>
<p><img src="http://www.morearty.com/blog/wp-content/uploads/2008/11/run-to-line.png" alt="" title="run-to-line" width="400" height="203" class="alignnone size-full wp-image-167" /></p>
<h3>Network monitor</h3>
<p>A major addition, this allows you to easily see the network traffic that is going back and forth between your app's front end and its back end.</p>
<p>Click for a closer view:<br />
<a href="http://www.morearty.com/blog/wp-content/uploads/2008/11/network-monitor.png"><img src="http://www.morearty.com/blog/wp-content/uploads/2008/11/network-monitor-300x279.png" alt="" title="network-monitor" width="300" height="279" class="alignnone size-medium wp-image-168" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.morearty.com/blog/2008/11/18/new-flex-builder-debugger-features-conditional-breakpoints-function-calls-from-expressions-watchpoints-and-more/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MAX talk: Extending Flex Builder</title>
		<link>http://www.morearty.com/blog/2008/10/30/max-talk-extending-flex-builder/</link>
		<comments>http://www.morearty.com/blog/2008/10/30/max-talk-extending-flex-builder/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 19:07:23 +0000</pubDate>
		<dc:creator>mike</dc:creator>
		
		<category><![CDATA[Adobe]]></category>

		<category><![CDATA[Flash/Flex/Flex Builder]]></category>

		<guid isPermaLink="false">http://www.morearty.com/blog/?p=160</guid>
		<description><![CDATA[I've been busily working on slides the the MAX talk that David Zuckerman and I are giving together, Extending Flex Builder.  This will be an interesting session for people who want to extend Flex Builder with their own add-ons.
The topics we'll be covering are:

The Code Model.  David will give this portion of the talk. [...]]]></description>
			<content:encoded><![CDATA[<p>I've been busily working on slides the the MAX talk that David Zuckerman and I are giving together, <a href="http://max.adobe.com/na/sessions/browser/#863">Extending Flex Builder</a>.  This will be an interesting session for people who want to extend Flex Builder with their own add-ons.</p>
<p>The topics we'll be covering are:</p>
<ul>
<li><strong>The Code Model.</strong>  David will give this portion of the talk. The Code Model is an API that lets you programmatically browse and modify the set of ActionScript classes, functions, etc. that are in the user's code.</li>
<li><strong>The Design Model.</strong>  This is another API that lets you programmatically browse and modify the MXML portions of the user's code.</li>
<li>If you write your own SWC (Flex library project) and want to customize how it shows up in the Components view when you give the SWC to another user, and also how it appears in the Properties view when they have an instance of your component selected in design view, you can add a file called <strong>design.xml</strong> to your SWC.</li>
<li>If we have time, we'll also give a very brief introduction to <strong>writing Eclipse plug-ins</strong>, which is necessary if you are going to be using the Code Model and the Design Model.  Not sure if there will be time for this, because there is so much other stuff we're trying to squeeze in.</li>
</ul>
<div>Hope to see you there!</div>
]]></content:encoded>
			<wfw:commentRss>http://www.morearty.com/blog/2008/10/30/max-talk-extending-flex-builder/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
