<?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>SteveX Compiled &#187; Adobe</title>
	<atom:link href="http://blog.stevex.net/category/adobe/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.stevex.net</link>
	<description>Software development and other notes.</description>
	<lastBuildDate>Tue, 07 Feb 2012 19:52:41 +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>UITableView, Multi Select and Swipe To Delete</title>
		<link>http://blog.stevex.net/2011/11/uitableview-swipe-to-delete/</link>
		<comments>http://blog.stevex.net/2011/11/uitableview-swipe-to-delete/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 18:15:44 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/?p=1907</guid>
		<description><![CDATA[I was having a problem recently with a UITableView, where the swipe-to-delete gesture wasn&#8217;t working. The documentation is pretty clear that your table will get the swipe to delete behaviour if you implement the tableView:commitEditingStyle:forRowAtIndexPath: method in your UITableViewDataSource delegate. So, in other words, implementing this one method in your data source should be enough [...]]]></description>
			<content:encoded><![CDATA[<p>I was having a problem recently with a UITableView, where the swipe-to-delete gesture wasn&#8217;t working.  </p>
<p>The documentation is pretty clear that your table will get the swipe to delete behaviour if you implement the <code class="codecolorer text dawn"><span class="text">tableView:commitEditingStyle:forRowAtIndexPath:</span></code> method in your <code class="codecolorer text dawn"><span class="text">UITableViewDataSource</span></code> delegate.</p>
<p>So, in other words, implementing this one method in your data source should be enough to enable swiping to delete a row:</p>
<div class="codecolorer-container objc dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>tableView<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITableView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>tableView commitEditingStyle<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITableViewCellEditingStyle<span style="color: #002200;">&#41;</span>editingStyle forRowAtIndexPath<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSIndexPath_Class/"><span style="color: #400080;">NSIndexPath</span></a> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>indexPath<br />
<span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>editingStyle <span style="color: #002200;">==</span> UITableViewCellEditingStyleDelete<span style="color: #002200;">&#41;</span> <br />
&nbsp; &nbsp; <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #11740a; font-style: italic;">// Delete the row from the data source.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#91;</span>self.model deleteItemAtIndex<span style="color: #002200;">:</span>indexPath.row<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #11740a; font-style: italic;">// And from the table itself </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#91;</span>tableView deleteRowsAtIndexPaths<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/"><span style="color: #400080;">NSArray</span></a> arrayWithObject<span style="color: #002200;">:</span>indexPath<span style="color: #002200;">&#93;</span> withRowAnimation<span style="color: #002200;">:</span>UITableViewRowAnimationFade<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; <span style="color: #002200;">&#125;</span> <br />
<span style="color: #002200;">&#125;</span></div></td></tr></tbody></table></div>
<p>But this wasn&#8217;t working for me.</p>
<p>After a bit of digging, I found the problem.  My table supports an edit mode that the user flips into by pressing an Edit button in the toolbar.  When in edit mode, the user can tap on multiple cells and then tap a trashcan at the bottom to delete all the selected cells.  This works nicely, but interferes with the swipe-to-delete gesture, in that swipe-to-delete isn&#8217;t supported when multiple selection is enabled in edit mode.</p>
<p>What I wanted was single selection when not in edit mode, and multiple selection when in edit mode.  This was easy enough to achieve:</p>
<div class="codecolorer-container objc dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>setEditing<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">BOOL</span><span style="color: #002200;">&#41;</span>editing animated<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">BOOL</span><span style="color: #002200;">&#41;</span>animated <br />
<span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; self.tableView.allowsMultipleSelectionDuringEditing <span style="color: #002200;">=</span> editing;<br />
&nbsp; &nbsp; <span style="color: #002200;">&#91;</span>super setEditing<span style="color: #002200;">:</span>editing animated<span style="color: #002200;">:</span>animated<span style="color: #002200;">&#93;</span>;<br />
<span style="color: #002200;">&#125;</span></div></td></tr></tbody></table></div>
<p>Make sure the table is set for Single Selection During Editing in Interface Builder, and that&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2011/11/uitableview-swipe-to-delete/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Annotated RTMP</title>
		<link>http://blog.stevex.net/2011/05/annotated-rtmp/</link>
		<comments>http://blog.stevex.net/2011/05/annotated-rtmp/#comments</comments>
		<pubDate>Fri, 27 May 2011 10:49:44 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Adobe]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/?p=1825</guid>
		<description><![CDATA[I&#8217;ve spent some time recently working on the RTMP protocol implementation of our Objective C iOS LCDS Messaging and Remoting client. (You can see a video of it in action here). The RTMP protocol was designed for streaming multimedia with the ability to interleave other kinds of content. It&#8217;s is a low-level binary protocol, so [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve spent some time recently working on the RTMP protocol implementation of our Objective C iOS LCDS Messaging and Remoting client.  (You can see a video of it in action <a href="http://coenraets.org/blog/2011/05/lcds-multi-client-support-native-ios-android-html-java-and-flex/">here</a>).</p>
<p>The RTMP protocol was designed for streaming multimedia with the ability to interleave other kinds of content.  It&#8217;s is a low-level binary protocol, so I&#8217;ve spent a lot of time over the last few months looking at dumps of bytes sent over the wire and decoding them to determine that we&#8217;re sending the right bytes and that they match what our other clients are sending and expecting. </p>
<p>For anyone else implementing RTMP, or just interested in it, I&#8217;ve cleaned up and annotated some parts of a typical RTMP session below for your reading pleasure.</p>
<p>This RTMP stream represents a client connecting to the server, and sending a request to subscribe to a messaging destination.  This example is how a client would start a data feed from the Market Data LCDS sample.  The subscribe message s an instance of &#8220;flex.messaging.messages.CommandMessage&#8221;, and looks like this:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">operation = multi_subscribe<br />
clientId = null<br />
correlationId = null<br />
destination = market-data-feed<br />
messageId = 3300FE5C-F850-451F-847C-B7D257E6D224<br />
timestamp = 1296478297471<br />
timeToLive = 0<br />
body = null<br />
hdr(DSMaxFrequency) = 1000<br />
hdr(DSAddSub) =<br />
&nbsp; [<br />
&nbsp; &nbsp; ADBE_;_<br />
&nbsp; ]</div></td></tr></tbody></table></div>
<p>And on to the protocol decoding.  Bytes being sent to the server from the client are denoted with > (greater than) and bytes coming the other direction are denoted &lt; (less than). </p>
<p>The first thing that happens is the client opens a socket connection to the RTMP server, and sends:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; 03</div></td></tr></tbody></table></div>
<p>This is the client telling the server &#8220;I support protocol version 3&#8243;.</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; (1536 bytes of random data)</div></td></tr></tbody></table></div>
<p>The client sends 1536 bytes of random data to the server.  This is part of a sequence of exchanges that the server and client use to make a guess as to their available bandwidth.</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt; 03</div></td></tr></tbody></table></div>
<p>This is the server responding with the protocol version that it is using.  All is well; both report version 3.</p>
</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt; (1536 bytes of random data)</div></td></tr></tbody></table></div>
<p>The server also sends 1536 bytes of random data.</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt; (Echo of the 1536 bytes that the client sent to the server)</div></td></tr></tbody></table></div>
<p>The server sends back the data that the client sent it.  This gives the client a way of guessing not only at bandwidth but a pretty good measure of latency.</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; (Echo of the 1536 bytes that the server sent to the client)</div></td></tr></tbody></table></div>
<p>The client does the same.</p>
<p>Now the initial handshake is done and we can start talking RTMP.</p>
<p>Our goal is to request a subscription to an LCDS messaging destination, so we need to send the message to do this.  This starts out with a chunk header (Type 0, section 6.1.2.1 of the RTMP spec):</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; 00 00 00 00 00 3D 11 00 00 00 00</div></td></tr></tbody></table></div>
<p>This decodes as a timestamp of 0 (the first 3 bytes), message length of 61 bytes (next 3 bytes), message type ID 17 (decimal, 0&#215;11), and a stream ID of 0 (the last 4 bytes).  The message type is 17, which means an AMF3 encoded message follows.</p>
<p>Here&#8217;s what the subscribe message looks like:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; 0x00 (msg format amf3)<br />
&gt; 0x02 0x00 0x07 5f726573756c74 (string &quot;_result&quot;)<br />
&gt; 0x05 (trxID = null - 0x05 is null in AMF0 and we're still in AMF0 mode)<br />
&gt; 0x05 (cmdData = null)<br />
&gt; 0x11 (AvmPlusObjectType (17) = an object follows)</div></td></tr></tbody></table></div>
<p>Writing the CommandMessage object:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; 0x0a // Type of what follow is an object, AMF3ObjectType, see section 3.1 of the AMF3 spec</div></td></tr></tbody></table></div>
<p>Next, internally we have a function that walks the object&#8217;s properties and serializes it.  The object&#8217;s properties are written first, then the values.  So here&#8217;s what the object&#8217;s properties look like on the wire:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; 0x81 0x13</div></td></tr></tbody></table></div>
<p>This is a variable-length 29-bit integer encoding (see 1.3.1 in the AMF3 spec) of the value 147 (0&#215;93) which is:  0&#215;03 (U290-traits) | 0&#215;08 (dynamic) | number of member names that follow (9 in this case).</p>
<p>Next we have the class name:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; 0x4d // ((utflen &lt;&lt; 1) | 1), utflen=38<br />
&gt; 66 6c 65 78 2e 6d 65 73 73 61 67 69 6e 67<br />
&gt; 2e 6d 65 73 73 61 67 65 73 2e 43 6f 6d 6d<br />
&gt; 61 6e 64 4d 65 73 73 61 67 65</div></td></tr></tbody></table></div>
<p>This is a string serialization of the 38 byte class name, &#8220;flex.messaging.messages.CommandMessage&#8221;.</p>
<p>Next we have the 9 property names, each represented as a UTF-8 variable length string:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; 0x13 6f 70 65 72 61 74 69 6f 6e &quot;timestamp&quot;<br />
&gt; 0x0f 68 65 61 64 65 72 73 &quot;headers&quot;<br />
&gt; 0x09 62 70 65 72 61 74 69 6f 6e &quot;operation&quot;<br />
&gt; 0x09 62 6f 64 79 &quot;body&quot;<br />
&gt; 0x1b 63 6f 72 72 65 6c 61 74 69 6f 6e 49 64 &quot;correlationId&quot;<br />
&gt; 0x13 6d 65 73 73 61 67 65 49 64 &quot;messageId&quot;<br />
&gt; 0x15 74 69 6d 65 54 6f 4c 69 76 65 &quot;timeToLive&quot; &nbsp; &nbsp;<br />
&gt; 0x13 74 69 6d 65 73 74 61 6d 70 &quot;timestamp&quot;<br />
&gt; 0x11 63 6c 69 65 6e 74 49 64 &quot;clientId&quot;<br />
&gt; 0x17 64 65 73 74 69 6e 61 74 69 6f 6e &quot;destination&quot;</div></td></tr></tbody></table></div>
<p>Now that the 9 names have been written, the 9 values are written (in the same order).</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; 5 42 72 de 1c d6 76 0 0</div></td></tr></tbody></table></div>
<p>0&#215;05 is a double, always written as 8 bytes</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; 0x0a object marker for 'headers'</div></td></tr></tbody></table></div>
<p>Next up is &#8216;headers&#8217;, a map of name/value pairs that&#8217;s written as a custom object.  This takes almost the same form as the object we&#8217;re currently in the middle of serializing, except that it&#8217;s an anonymous class.</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; 0x43 // 4&lt;&lt;4 | 3 = embedded object (not a reference), 3 properties<br />
&gt; 0x1 // object name (empty string in this case - 0x01 is the marker for a null)</div></td></tr></tbody></table></div>
<p>Next the traits for the headers:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; 0x1d 44 53 4d 61 78 46 72 65 71 75 65 6e 63 79 &quot;DSMaxFrequency&quot;<br />
&gt; 0x9 44 53 49 64 &nbsp;&quot;DSId&quot;<br />
&gt; 0x11 44 53 41 64 64 53 75 62 &quot;DSAddSub&quot;<br />
&gt; 15 44 53 45 6e 64 70 6f 69 6e 74 &quot;DSEndpoint&quot;</div></td></tr></tbody></table></div>
<p>Next, the values for the headers:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; 0x04 87 68</div></td></tr></tbody></table></div>
<p>DSMaxFrequency header.  0&#215;04 is an integer, and the next 2 bytes are a UInt29 representation of the integer value 1000.  1000 is ((7&lt;&lt;7) | 0&#215;68).</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; 0x06 0x49 34 34 36 41 31 32 38 37 2d 42 31 41 <br />
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 46 2d 30 44 33 38 2d 43 35 31 41 2d <br />
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 38 41 45 32 36 31 43 46 44 41 39 42</div></td></tr></tbody></table></div>
<p>DSId header.  0&#215;06 is a string; 0&#215;49 is the length of the string &lt;&lt; 1 with bit 0 unset.  If bit 0 was not set, then it would be a reference into a string table.  The string length is 36 bytes (it&#8217;s a GUID) &lt;&lt; 1 | 1.</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; 0x09 0x03 0x01 0x06 0x0f 41 44 42 45 5f 3b 5f</div></td></tr></tbody></table></div>
<p>DSAddSub header.  This is an array (0&#215;09) of 1 element (bit 1 is always set, count is shifted left one), with no name (0&#215;01 indicates a null string).  The one element is a string (0&#215;06) of length 7 (0x0f = 7 &lt;&lt; 1 | 1), containing the bytes &#8220;ADBE_;_&#8221;.  This is what we&#8217;re subscribing to.</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; 0x06 0x0f 6d 79 2d 72 74 6d 70 &quot;my-rtmp&quot;</div></td></tr></tbody></table></div>
<p>DSEndpoint header.  The endpoint name, &#8220;my-rtmp&#8221;.</p>
<p>(At this point we&#8217;re done with the embedded headers array and we&#8217;re back to serializing the properties of the CommandMessage, continuing with the &#8216;operation&#8217; property).</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; 0x09 0xb</div></td></tr></tbody></table></div>
<p>The &#8216;operation&#8217; property is an integer, value 11.  Operation 11 is the multi-subscribe operation.  (You can see the operations in the BlazeDS documentation for CommandMessage).  http://livedocs.adobe.com/blazeds/1/javadoc/constant-values.html#flex.messaging.messages.CommandMessage.MULTI_SUBSCRIBE_OPERATION</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; 0x01 (body = null)<br />
&gt; 0x01 (correlationId = null)<br />
&gt; 0x06 0x49 37 35 37 35 44 42 45 34 2d 42 30 31<br />
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 32 2d 34 41 45 46 2d 42 43 37 41 2d<br />
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 41 37 34 44 30 36 43 46 37 42 46 44</div></td></tr></tbody></table></div>
<p>The messageId is a GUID, sent similarly to the  DSId header above.</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; 0x05 0 0 0 0 0 0 0 0</div></td></tr></tbody></table></div>
<p>timeToLive is of type double (0&#215;05) value zero (doubles are always 8 bytes).</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; 0x01 (clientId = null)<br />
&gt; 0x06 0x21 6d 61 72 6b 65 74 2d 64 61 74 61 2d 66 65 65 64 (market-data-feed)</div></td></tr></tbody></table></div>
<p>Finally, the name of the feed that we&#8217;re subscribing to, &#8220;market-data-feed&#8221;.</p>
<p>And that&#8217;s that. </p>
<p>As you can tell RTMP and AMF3 are incredibly efficient binary protocols &#8211; the decoded streams above show the efficiency of the protocol in general but don&#8217;t show one of the other big gains, the tables that the client and server maintain so that if a string or object has already been sent once during a session, all that needs to be sent over the wire is a reference to the string, not the string itself.  This shaves many more bytes off the session.</p>
<p>And why is that important?  Well, especially in mobile apps, users are paying for bytes.  There is typically less bandwidth.  And even if your clients don&#8217;t mind the traffic, think of the bytes you&#8217;re saving on the server side when you&#8217;ve got a few thousand clients connected and receiving streaming updates.  It can be significant.</p>
<p>Looking for more information about RTMP?  The spec is <a href="http://www.adobe.com/devnet/rtmp.html">here</a>. The AMF3 spec is <a href="http://opensource.adobe.com/wiki/download/attachments/1114283/amf3_spec_05_05_08.pdf">here</a>, and it builds on the AMF0 spec which is <a href="http://opensource.adobe.com/wiki/download/attachments/1114283/amf0_spec_121207.pdf">here</a>.<br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2011/05/annotated-rtmp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex Component Showing in Flex Builder</title>
		<link>http://blog.stevex.net/2010/02/flex-component-showing-in-flex-builder/</link>
		<comments>http://blog.stevex.net/2010/02/flex-component-showing-in-flex-builder/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 03:35:09 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Adobe]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/?p=1602</guid>
		<description><![CDATA[I ran into a problem a few days ago with a Flex component that I was building not showing up in Flash Builder when built using our command-line build, but showing up fine when built by the IDE (Flex Builder). It took me a bit of searching to figure out what the problem was, which [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into a problem a few days ago with a Flex component that I was building not showing up in Flash Builder when built using our command-line build, but showing up fine when built by the IDE (Flex Builder).</p>
<p>It took me a bit of searching to figure out what the problem was, which means it&#8217;s worth posting the solution here.</p>
<p>Flex Builder&#8217;s design view is extensible.  New components that you build can show up in the Components panel, and users can drag them onto the design surface.  You need to do a few things for this to work.</p>
<p>First, you need a design.xml file in your SWC.  This file tells Flex Builder about your component.  Here&#8217;s an example:</p>
<div class="codecolorer-container xml dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;design<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;namespaces<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;namespace</span> <span style="color: #000066;">prefix</span>=<span style="color: #ff0000;">&quot;myproject&quot;</span> <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/2009/myproject&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/namespaces<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;categories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;category</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;myproject&quot;</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;myproject&quot;</span> <span style="color: #000066;">defaultExpand</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/categories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;components<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;component</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;MyImage&quot;</span> <span style="color: #000066;">namespace</span>=<span style="color: #ff0000;">&quot;myproject&quot;</span> <span style="color: #000066;">category</span>=<span style="color: #ff0000;">&quot;myproject&quot;</span> <span style="color: #000066;">insertStyle</span>=<span style="color: #ff0000;">&quot;control&quot;</span> <span style="color: #000066;">displayName</span>=<span style="color: #ff0000;">&quot;MyImage&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;defaultAttribute</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;cellName&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mxmlProperties</span> <span style="color: #000066;">use</span>=<span style="color: #ff0000;">&quot;mx:Image&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;textfield</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;cellName&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Cell Name:&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;combo</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;autoInvokeTargetURL&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Auto Invoke Target URL:&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mxmlProperties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/component<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/components<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/design<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>I had that right in my SWC, but I was missing two things.  The ant script that I was using for my command-line build wasn&#8217;t including the design.xml file.   After adding that, here&#8217;s what the ant target for the SWC compile looks like:</p>
<div class="codecolorer-container xml dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;build&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;java</span> <span style="color: #000066;">jar</span>=<span style="color: #ff0000;">&quot;${flex.sdk.home}/lib/compc.jar&quot;</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;.&quot;</span> <span style="color: #000066;">fork</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">failonerror</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;jvmarg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-Xmx512m&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-load-config=${flex.sdk.home}/frameworks/flex-config.xml&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-compiler.fonts.local-fonts-snapshot=${flex.sdk.home}/frameworks/localFonts.ser&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-headless-server=true&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-include-file=design.xml,src/design.xml&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-source-path=src&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-compiler.namespaces.namespace=http://www.adobe.com/2009/myproject,src/manifest.xml&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-include-namespaces=http://www.adobe.com/2009/myproject&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-compiler.debug=${flex.debug}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-compiler.external-library-path+=${flex.sdk.home}/frameworks/libs/framework.swc&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-o=bin/${swc}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/java<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>Note the include-file line, which gives the name of the file and then the source path to it.</p>
<p>And the other thing that was missing was the namespace mapping.  The compiler.namespaces.namespace argument identifies the namespace for the component (which has to match the namespace from the design.xml) and the manifest to use for the classes in that namespace.</p>
<p>The last piece is the manifest file.  Here&#8217;s what that looks like:</p>
<div class="codecolorer-container xml dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;componentPackage<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;component</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;MyImage&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.stevex.myproject.MyImage&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/componentPackage<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>With all this set up, dropping the SWC into a Flex project&#8217;s libs folder will immediately show the MyImage component in the Components panel ready to drag onto the design surface.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2010/02/flex-component-showing-in-flex-builder/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Windows 7 Taskbar Notifications</title>
		<link>http://blog.stevex.net/2009/11/windows-7-taskbar-notifications/</link>
		<comments>http://blog.stevex.net/2009/11/windows-7-taskbar-notifications/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 14:45:45 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/?p=1578</guid>
		<description><![CDATA[With Windows XP and Vista, when an application wanted to attract your attention, it would flash its window in the task bar. When it stopped flashing, it would stay a fairly obvious orange colour. Windows 7 uses a different mechanism, and one I find far too subtle. Looking at this, you&#8217;re probably thinking &#8220;hey it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>With Windows XP and Vista, when an application wanted to attract your attention, it would flash its window in the task bar.  When it stopped flashing, it would stay a fairly obvious orange colour.</p>
<p><img src="http://blog.stevex.net/files/2009/11/200911130946.jpg" height="32" width="138" border="1" hspace="4" vspace="4" alt="200911130946" /><br />
Windows 7 uses a different mechanism, and one I find far too subtle.  </p>
<p><img src="http://blog.stevex.net/files/2009/11/200911130954.jpg" height="42" width="428" border="1" hspace="4" vspace="4" alt="200911130954" /><br />
Looking at this, you&#8217;re probably thinking &#8220;hey it&#8217;s obvious, the orange one wants your attention&#8221;.  And it does seem that way, but for some reason I find myself, with Windows 7, missing IM notifications and not responding to messages until hours later, because I just didn&#8217;t notice that I had a new message.</p>
<p>Maybe it&#8217;s because of all the additional noise in the taskbar &#8211; it&#8217;s harder to tell at a glance that an app wants your attention, so I don&#8217;t pick it up &#8220;out of the corner of my eye&#8221; the way I would with the XP style.</p>
<p>The Mac continues to animate icons that want your attention until you give in and click on it.  Windows animates the icon for a few seconds and then settles on the orange look.  One solution would be to change Windows 7 so that the animation continues until you respond.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2009/11/windows-7-taskbar-notifications/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flash Builder 4 Keyboard Tips</title>
		<link>http://blog.stevex.net/2009/10/flash-builder-4-keyboard-tips/</link>
		<comments>http://blog.stevex.net/2009/10/flash-builder-4-keyboard-tips/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 14:54:12 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Adobe]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/?p=1552</guid>
		<description><![CDATA[I just watched a MAX 2009 video on Flash Builder 4 Advanced Tips and Tricks. I&#8217;m a keyboard user and this video focuses on how to get the most out of Flex Builder using the keyboard. It&#8217;s well worth watching, but if you&#8217;re not going to watch it, here are some that I found especially [...]]]></description>
			<content:encoded><![CDATA[<p>I just watched a MAX 2009 video on Flash Builder 4 Advanced Tips and Tricks.  I&#8217;m a keyboard user and this video focuses on how to get the most out of Flex Builder using the keyboard.  It&#8217;s well worth watching, but if you&#8217;re not going to watch it, here are some that I found especially useful.</p>
<p>Ctrl-3 &#8211; Brings up a way to search within the app for commands.<br />
Ctrl-O &#8211; Navigate quickly within the current file (type to filter)<br />
Ctrl-Shift-T &#8211; Open Type (filter for types using caps &#8211; BB for ButtonBar)<br />
Ctrl-Shift-R &#8211; same thing but for non-code (resources, xml files, etc)<br />
Ctrl-I &#8211; put cursor at right indentation for current line or reindent selection<br />
Ctrl-D &#8211; delete current line<br />
Ctrl-M &#8211; toggle maximize the editor</p>
<p>Also you can hold down the Ctrl key to turn any symbol in the editor into a hyperlink.</p>
<p>Some of these are Flex shortcuts and some are Flash Builder. </p>
<p>Here&#8217;s the video:</p>
<p><object width="425" height="256"><param name="movie" value="http://images.tv.adobe.com//swf/player.swf"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="FlashVars" value="fileID=2338&#038;context=162&#038;embeded=true&#038;environment=production"></param><embed src="http://images.tv.adobe.com//swf/player.swf" flashvars="fileID=2338&#038;context=162&#038;embeded=true&#038;environment=production" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="256"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2009/10/flash-builder-4-keyboard-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash Text Layout Framework goes Open Source</title>
		<link>http://blog.stevex.net/2009/07/flash-text-layout-framework-goes-open-source/</link>
		<comments>http://blog.stevex.net/2009/07/flash-text-layout-framework-goes-open-source/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 10:19:31 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Adobe]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/?p=1496</guid>
		<description><![CDATA[The Flash Platform team at Adobe announced yesterday that they&#8217;re open-sourcing the Text Layout Framework that they&#8217;ve been working on on top of the text foundation built into Flash 10. This is Kind of a Big Deal, because as far as I&#8217;m aware open-source code that handles text editing and display of Unicode text that [...]]]></description>
			<content:encoded><![CDATA[<p>The Flash Platform team at Adobe announced yesterday that they&#8217;re <a href="http://blogs.adobe.com/tlf/2009/07/the_text_layout_framework_is_n.html">open-sourcing the Text Layout Framework</a> that they&#8217;ve been working on on top of the text foundation built into Flash 10.</p>
<p>This is Kind of a Big Deal, because as far as I&#8217;m aware open-source code that handles text editing and display of Unicode text that supports right-to-left layout and editing is very rare. </p>
<p>I work on LiveCycle Designer, and because we made a commitment to a partner to support it, our XML editor lets you edit XML source that has HATV (Hebrew, Arabic, Thai, Vietnamese) text embedded in it.  If you&#8217;re not familiar with these languages, in a nutshell, they&#8217;re read from right to left instead of left to right the way English is read.  A text editor that supports these languages will understand that they&#8217;re edited from right to left as well, which changes how the editor behaves when the caret is in an RTL text run.  For example:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;Button id=&quot;לחצן&quot;/&gt;</div></td></tr></tbody></table></div>
<p>This is some XML that might represent a button whose ID is &#8220;Button&#8221; in Hebrew.  Drag-select over that text.  Does your browser treat the Hebrew text differently than the surrounding English characters?  It probably does.  </p>
<p>When you&#8217;re editing, the typical behaviour is if the caret were on the equal sign and you hit right arrow a few times, the caret would move to the quote, then to the last character of the Hebrew text, then left, left, left, left, then jump to the closing quote.  This is because the right arrow key is interpreted as &#8220;move to the next character&#8221;, not &#8220;move right&#8221;.</p>
<p>The TLF that Adobe is giving away comes with a TextEditor class that knows about all this.  Copy that text and paste it into the <a href="http://labs.adobe.com/technologies/textlayout/demos/">TLF Sample</a> and try editing it yourself.</p>
<p>The TLF supports a lot of other cool text features.  Here&#8217;s a list:</p>
<ul>
<li>Selection, editing and flowing text across multiple columns and linked containers
<li>Vertical text, Tate-Chu-Yoko (horizontal within vertical text) and justifier for East Asian typography
<li>Rich typographical controls, including kerning, ligatures, typographic case, digit case, digit width and discretionary hyphens
<li>Cut, copy, paste, undo and standard keyboard and mouse gestures for editing
<li>Rich developer APIs to manipulate text content, layout, markup and create custom text components
<li>ActionScript-based object-oriented model for rich text layout enabling live updates
</ul>
<p>But the RTL text support is the one that affects me most since we&#8217;ve been looking for a replacement for what we currently use in Designer, and this might be it.</p>
<p>There are a lot of open-source text editors, but as far as I know the only one that supports this is the code editor in Eclipse, which is written in Java.  The text input widgets on the major OS platforms support it, and now, so does Flash.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2009/07/flash-text-layout-framework-goes-open-source/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iTunes vs the Palm Pre</title>
		<link>http://blog.stevex.net/2009/07/itunes-vs-the-palm-pre/</link>
		<comments>http://blog.stevex.net/2009/07/itunes-vs-the-palm-pre/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 03:28:21 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Adobe]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/?p=1486</guid>
		<description><![CDATA[Apple&#8217;s iTunes 8.2.1 update broke syncing with the Palm Pre. Normally when companies do this sort of thing &#8211; make changes that break another company&#8217;s product &#8211; they don&#8217;t brag about it. They say that it&#8217;s not a supported configuration and you&#8217;re left to wonder if it broke as a natural consequence of some changes [...]]]></description>
			<content:encoded><![CDATA[<p>Apple&#8217;s iTunes 8.2.1 update broke syncing with the Palm Pre.</p>
<p><img src="http://blog.stevex.net/files/2009/07/200907162326.jpg" height="121" width="133" border="0" align="right" hspace="4" vspace="4" alt="200907162326" /></p>
<p>Normally when companies do this sort of thing &#8211; make changes that break another company&#8217;s product &#8211; they don&#8217;t brag about it.  They say that it&#8217;s not a supported configuration and you&#8217;re left to wonder if it broke as a natural consequence of some changes they were making, when in fact they probably broke it on purpose.</p>
<p>But not this time.  Apple specifically <a href="http://support.apple.com/downloads/iTunes_8_2_1">stated</a> that the iTunes 8.2.1 update &#8220;addresses an issue with the verification of Apple devices&#8221;.</p>
<p>I don&#8217;t feel right about this one.  On the one hand Apple is probably within it&#8217;s rights to do this.  iTunes is free, supported by the money that the iTunes Music Store makes and some of the device revenues.  Before the store, iTunes was completely supported by device revenues, and software tying itself to a hardware purchase is nothing new.  CD Burner software, for example, has often checked that the manufacturer of the drive is the one that the software came bundled with. </p>
<p>What makes this feel different is that iTunes is middleware between my music and my device.  I&#8217;m paying Apple for the music, so I feel like I should have the right to use iTunes to get that music onto my music player, whatever that player may be. </p>
<p>I support Apple&#8217;s right to do this, but I don&#8217;t think it&#8217;s very nice of them to do it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2009/07/itunes-vs-the-palm-pre/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why I Like Flash Video</title>
		<link>http://blog.stevex.net/2009/07/why-i-like-flash-video/</link>
		<comments>http://blog.stevex.net/2009/07/why-i-like-flash-video/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 18:01:25 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/?p=1482</guid>
		<description><![CDATA[I like Flash video because I hate this:]]></description>
			<content:encoded><![CDATA[<p>I like Flash video because I hate this:</p>
<p><img src="http://blog.stevex.net/files/2009/07/200907131359.jpg" height="204" width="485" border="1" hspace="4" vspace="4" alt="200907131359" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2009/07/why-i-like-flash-video/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Summer Shutdown</title>
		<link>http://blog.stevex.net/2009/06/summer-shutdown/</link>
		<comments>http://blog.stevex.net/2009/06/summer-shutdown/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 11:55:53 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Adobe]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/?p=1465</guid>
		<description><![CDATA[John Nack blogged about Adobe&#8217;s summer shutdown, and I just wanted to chime in and say I agree with him 100%. The idea of a week where everyone is of is much preferable to random weeks off. It would be bad if someone have a specific reason they wanted to take some other summer week [...]]]></description>
			<content:encoded><![CDATA[<p>John Nack blogged about <a href="http://blogs.adobe.com/jnack/2009/06/adobe_is_closed_this_week.html">Adobe&#8217;s summer shutdown</a>, and I just wanted to chime in and say I agree with him 100%.  The idea of a week where everyone is of is much preferable to random weeks off.  It would be bad if someone have a specific reason they wanted to take some other summer week off (like a trip booked way in advance or an event they wanted to attend), but given the amount of notice we had, I don&#8217;t actually know anyone who was in that situation.</p>
<p>John mentioned teams incorporating the shutdown into their scheduling.  Isn&#8217;t that a radical idea?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2009/06/summer-shutdown/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FlexAccount, a Simple Login System for Flex</title>
		<link>http://blog.stevex.net/2009/05/flexaccount-a-simple-login-system-for-flex/</link>
		<comments>http://blog.stevex.net/2009/05/flexaccount-a-simple-login-system-for-flex/#comments</comments>
		<pubDate>Wed, 06 May 2009 13:38:22 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Adobe]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/?p=1431</guid>
		<description><![CDATA[Here&#8217;s a little project I&#8217;ve been working on, on and off, for some time: A login system for simple Flex-based applications with a PHP back end. It&#8217;s called FlexAccount, and there&#8217;s information and a download at that link. I posted it yesterday and this article by Jeff Atwood made me think of calling it out [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a little project I&#8217;ve been working on, on and off, for some time:  A login system for simple Flex-based applications with a PHP back end.</p>
<p>It&#8217;s called <a href="http://blog.stevex.net/index.php/software/flexaccount/">FlexAccount</a>, and there&#8217;s information and a download at that link.</p>
<p>I posted it yesterday and <a href="http://www.codinghorror.com/blog/archives/001263.html">this article by Jeff Atwood</a> made me think of calling it out today.  One of my goals with FlexAccount was to create something that&#8217;s a reasonable representation of best practices, and that includes salting passwords in the database, using a unique, per-user salt. </p>
<p>If you start with FlexAccount, then you&#8217;re storing passwords correctly.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2009/05/flexaccount-a-simple-login-system-for-flex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

