<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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>Comments on: AS3 number to hex converter</title>
	<atom:link href="http://dispatchevent.org/mims/as3-number-to-hex-converter/feed/" rel="self" type="application/rss+xml" />
	<link>http://dispatchevent.org/mims/as3-number-to-hex-converter/</link>
	<description>Collective thoughts on the Flash Platform, iOS, Unity, and any other technology we use.</description>
	<lastBuildDate>Wed, 09 May 2012 04:35:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: laughing</title>
		<link>http://dispatchevent.org/mims/as3-number-to-hex-converter/comment-page-1/#comment-150424</link>
		<dc:creator>laughing</dc:creator>
		<pubDate>Thu, 11 Jun 2009 12:11:26 +0000</pubDate>
		<guid isPermaLink="false">http://dispatchevent.org/?p=618#comment-150424</guid>
		<description>Yeah, so i tried using this and ran into an overflow bug I believe.  Spent a good 15 minutes debugging it and then came back to see if anyone else had had the problem.  I guess I learned you should read to the bottom.

Good work Mario</description>
		<content:encoded><![CDATA[<p>Yeah, so i tried using this and ran into an overflow bug I believe.  Spent a good 15 minutes debugging it and then came back to see if anyone else had had the problem.  I guess I learned you should read to the bottom.</p>
<p>Good work Mario</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mario gonzalez</title>
		<link>http://dispatchevent.org/mims/as3-number-to-hex-converter/comment-page-1/#comment-148641</link>
		<dc:creator>mario gonzalez</dc:creator>
		<pubDate>Thu, 21 May 2009 03:09:08 +0000</pubDate>
		<guid isPermaLink="false">http://dispatchevent.org/?p=618#comment-148641</guid>
		<description>Or you could use:

var num:uint = 123456789
trace(num.toString(16))</description>
		<content:encoded><![CDATA[<p>Or you could use:</p>
<p>var num:uint = 123456789<br />
trace(num.toString(16))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mims H Wright</title>
		<link>http://dispatchevent.org/mims/as3-number-to-hex-converter/comment-page-1/#comment-141358</link>
		<dc:creator>Mims H Wright</dc:creator>
		<pubDate>Tue, 10 Mar 2009 17:15:14 +0000</pubDate>
		<guid isPermaLink="false">http://dispatchevent.org/?p=618#comment-141358</guid>
		<description>@aamp
Numbers larger than 0xFFFFFFFF exceed the memory size for a uint and will produce unexpected results.</description>
		<content:encoded><![CDATA[<p>@aamp<br />
Numbers larger than 0xFFFFFFFF exceed the memory size for a uint and will produce unexpected results.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aamp</title>
		<link>http://dispatchevent.org/mims/as3-number-to-hex-converter/comment-page-1/#comment-141336</link>
		<dc:creator>aamp</dc:creator>
		<pubDate>Tue, 10 Mar 2009 12:59:06 +0000</pubDate>
		<guid isPermaLink="false">http://dispatchevent.org/?p=618#comment-141336</guid>
		<description>var k:int = 0x756c61626173;
trace(getNumberAsHexString(k));


procudes:

Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds.</description>
		<content:encoded><![CDATA[<p>var k:int = 0x756c61626173;<br />
trace(getNumberAsHexString(k));</p>
<p>procudes:</p>
<p>Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pimm Hogeling</title>
		<link>http://dispatchevent.org/mims/as3-number-to-hex-converter/comment-page-1/#comment-138316</link>
		<dc:creator>Pimm Hogeling</dc:creator>
		<pubDate>Sat, 14 Feb 2009 11:09:40 +0000</pubDate>
		<guid isPermaLink="false">http://dispatchevent.org/?p=618#comment-138316</guid>
		<description>Being a big Nintendo fan, I find myself working with bits and bytes all the time. I even listen to 8 bit music from 8bitpeoples.com (you should check that out). I can understand how a non-bit geek would write the code like you do, but I&#039;d go for something like this:

package org.as3lib.math
{
        /**
         * Converts a uint into a string in the format &quot;0x123456789ABCDEF&quot;. 
         * This function is quite useful for displaying hex colors as text.
         * The function &lt;code&gt;toString(radix:uint)&lt;/code&gt; does a similar job but doesn&#039;t include
         * &quot;0x&quot; at the beginning of the result nor does it include leading zeroes.
         * 
         * @author Mims H. Wright
         * 
         * @use getNumberAsHexString(255); // 0xFF
         *              getNumberAsHexString(0xABCDEF); // 0xABCDEF
         *              getNumberAsHexString(0x00FFCC); // 0xFFCC
         *              getNumberAsHexString(0x00FFCC, 6); // 0x00FFCC
         * 
         * 
         * @param number The number to convert to hex. Note, numbers larger than 0xFFFFFFFF may produce unexpected results.
         * @param minimumLength The smallest number of hexits to include in the output. 
         *                      Missing places will be filled in with 0&#039;s. 
         *                      e.g. getNumberAsHexString(0xFF33, 6); // results in &quot;0x00FF33&quot;
         * @return String representation of the number as a string starting with &quot;0x&quot; 
         */
        public function getNumberAsHexString(number:uint, minimumLength:uint = 1):String {
                // The string that will be output at the end of the function.
                var string:String = number.toString(0x10).toUpperCase();
                
                // While the minimumLength argument is higher than the length of the string, add a leading zero.
                while (minimumLength &gt; string.length) {
                        string = &quot;0&quot; + string;
                }
                
                // Return the result with a &quot;0x&quot; in front of the result.
                return &quot;0x&quot; + string;
        }
}

I hereby donate the copyrights over this work to you, Mims H. Wright.</description>
		<content:encoded><![CDATA[<p>Being a big Nintendo fan, I find myself working with bits and bytes all the time. I even listen to 8 bit music from 8bitpeoples.com (you should check that out). I can understand how a non-bit geek would write the code like you do, but I&#8217;d go for something like this:</p>
<p>package org.as3lib.math<br />
{<br />
        /**<br />
         * Converts a uint into a string in the format &#8220;0x123456789ABCDEF&#8221;.<br />
         * This function is quite useful for displaying hex colors as text.<br />
         * The function <code>toString(radix:uint)</code> does a similar job but doesn&#8217;t include<br />
         * &#8220;0x&#8221; at the beginning of the result nor does it include leading zeroes.<br />
         *<br />
         * @author Mims H. Wright<br />
         *<br />
         * @use getNumberAsHexString(255); // 0xFF<br />
         *              getNumberAsHexString(0xABCDEF); // 0xABCDEF<br />
         *              getNumberAsHexString(0x00FFCC); // 0xFFCC<br />
         *              getNumberAsHexString(0x00FFCC, 6); // 0x00FFCC<br />
         *<br />
         *<br />
         * @param number The number to convert to hex. Note, numbers larger than 0xFFFFFFFF may produce unexpected results.<br />
         * @param minimumLength The smallest number of hexits to include in the output.<br />
         *                      Missing places will be filled in with 0&#8242;s.<br />
         *                      e.g. getNumberAsHexString(0xFF33, 6); // results in &#8220;0x00FF33&#8243;<br />
         * @return String representation of the number as a string starting with &#8220;0x&#8221;<br />
         */<br />
        public function getNumberAsHexString(number:uint, minimumLength:uint = 1):String {<br />
                // The string that will be output at the end of the function.<br />
                var string:String = number.toString(0&#215;10).toUpperCase();</p>
<p>                // While the minimumLength argument is higher than the length of the string, add a leading zero.<br />
                while (minimumLength &gt; string.length) {<br />
                        string = &#8220;0&#8243; + string;<br />
                }</p>
<p>                // Return the result with a &#8220;0x&#8221; in front of the result.<br />
                return &#8220;0x&#8221; + string;<br />
        }<br />
}</p>
<p>I hereby donate the copyrights over this work to you, Mims H. Wright.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

