<?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>dispatchEvent() Blog™ &#187; hexadecimal</title>
	<atom:link href="http://dispatchevent.org/tag/hexadecimal/feed/" rel="self" type="application/rss+xml" />
	<link>http://dispatchevent.org</link>
	<description>Collective thoughts on the Flash Platform, iOS, Unity, and any other technology we use.</description>
	<lastBuildDate>Tue, 17 Aug 2010 08:15:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>AS3 number to hex converter</title>
		<link>http://dispatchevent.org/mims/as3-number-to-hex-converter/</link>
		<comments>http://dispatchevent.org/mims/as3-number-to-hex-converter/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 01:38:44 +0000</pubDate>
		<dc:creator>Mims H Wright</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Lab]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[as3lib]]></category>
		<category><![CDATA[bitwise]]></category>
		<category><![CDATA[converter]]></category>
		<category><![CDATA[hex]]></category>
		<category><![CDATA[hexadecimal]]></category>
		<category><![CDATA[hexit]]></category>
		<category><![CDATA[math]]></category>

		<guid isPermaLink="false">http://dispatchevent.org/?p=618</guid>
		<description><![CDATA[I&#8217;ve been working on some code for converting colors lately and getting quite into bitwise operations. In one of the demos I was making, I needed a quick and easy way to see the results of a color calculation. Of &#8230; <a href="http://dispatchevent.org/mims/as3-number-to-hex-converter/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on some code for converting colors lately and getting quite into bitwise operations. In one of the demos I was making, I needed a quick and easy way to see the results of a color calculation. Of course, simply tracing a number, even if it&#8217;s in the format 0xFF, will result in a digital number string &#8220;255&#8243;. I&#8217;ve always been a little stumped about how to do this calculation but I realized that it&#8217;s actually very easy to do with the <a href="http://livedocs.adobe.com/flex/3/langref/operators.html#bitwise_AND">&amp;</a> and <a href="http://livedocs.adobe.com/flex/3/langref/operators.html#bitwise_unsigned_right_shift">&gt;&gt;&gt;</a> bitwise operators.</p>
<p><code><br />
getNumberAsHexString(255); // 0xFF<br />
getNumberAsHexString(0xABCDEF); // 0xABCDEF<br />
getNumberAsHexString(0x00FFCC); // 0xFFCC<br />
getNumberAsHexString(0x00FFCC, 6); // 0x00FFCC - Uses 6 as a minimum number of hexits</code></p>
<p>I&#8217;ve added the code to the <a href="http://as3lib.org">AS3lib</a> as  as a global function. I may move it to a utility class later on. You can <a href="http://code.google.com/p/as3lib/source/browse/trunk/src/org/as3lib/math/getNumberAsHexString.as">view the source</a> on Google Code.</p>
<p>Incidentally, in a moment of bug-fixing frustration, I found <a href="http://kinderas.blogspot.com/2008/01/quicktip-actionscript-3-and-number.html">this article on O.C.A.S.</a> which describes how the same functionality is already built into the <code>toString()</code> method! However, the work isn&#8217;t completely wasted since my version includes the option to show leading zeroes and adds &#8220;<code>0x</code>&#8221; at the front of the result.</p>
]]></content:encoded>
			<wfw:commentRss>http://dispatchevent.org/mims/as3-number-to-hex-converter/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
