<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>

<channel>
	<title>Building Blocks &#187; travel</title>
	<atom:link href="http://joelhooks.com/category/travel/feed/" rel="self" type="application/rss+xml" />
	<link>http://joelhooks.com</link>
	<description>[without unit tests] you&#039;re not refactoring; you&#039;re just changing shit. -Hamlet D&#039;Arcy</description>
	<lastBuildDate>Fri, 30 Dec 2011 04:11:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/us/</creativeCommons:license>
		<item>
		<title>Actionscript string replacement and international currency.</title>
		<link>http://joelhooks.com/2008/01/15/actionscript-string-replacement-and-international-currency/</link>
		<comments>http://joelhooks.com/2008/01/15/actionscript-string-replacement-and-international-currency/#comments</comments>
		<pubDate>Tue, 15 Jan 2008 23:04:50 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[travel]]></category>

		<guid isPermaLink="false">http://joelhooks.com/2008/01/15/actionscript-string-replacement-and-international-currency/</guid>
		<description><![CDATA[<style type="text/css">
#leftcontainerBox {
float:left;
position: fixed;
top: 60%;
left: 5px;
}

#leftcontainerBox .buttons {
float:left;
clear:both;
margin:4px 4px 4px 4px;

padding-bottom:2px;
}


#bottomcontainerBox {
height: 30px;
width:50%;
padding-top:1px;
}

#bottomcontainerBox .buttons {
float:left;
height: 30px;
margin:4px 4px 4px 4px;
}

</style>
This made me a little nostalgic for the olden days when a vacation to Europe was a remote possibility: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 var str:String = &#34;Now only $9.95!&#34;; var price:RegExp = /\$&#40;&#91;\d,&#93;+.\d+&#41;+/i; trace&#40;str.replace&#40;price, usdToEuro&#41;&#41;; &#160; function usdToEuro&#40;matchedSubstring:String, capturedMatch1:String, index:int, str:String&#41;:String &#123; var usd:String [...]]]></description>
			<content:encoded><![CDATA[<style type="text/css">
#leftcontainerBox {
float:left;
position: fixed;
top: 60%;
left: 5px;
}

#leftcontainerBox .buttons {
float:left;
clear:both;
margin:4px 4px 4px 4px;

padding-bottom:2px;
}


#bottomcontainerBox {
height: 30px;
width:50%;
padding-top:1px;
}

#bottomcontainerBox .buttons {
float:left;
height: 30px;
margin:4px 4px 4px 4px;
}

</style>
<p>This made me a little nostalgic for the olden days when a vacation to Europe was a remote possibility:</p>

<div class="wp_codebox"><table><tr id="p92"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code" id="p9code2"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> str:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;Now only $9.95!&quot;</span>;
<span style="color: #000000; font-weight: bold;">var</span> price:RegExp = <span style="color: #66cc66;">/</span>\$<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span>\d,<span style="color: #66cc66;">&#93;</span>+.\d+<span style="color: #66cc66;">&#41;</span>+<span style="color: #66cc66;">/</span>i;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>str.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span>price, usdToEuro<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> usdToEuro<span style="color: #66cc66;">&#40;</span>matchedSubstring:<span style="color: #0066CC;">String</span>,
                    capturedMatch1:<span style="color: #0066CC;">String</span>,
                    <span style="color: #0066CC;">index</span>:<span style="color: #0066CC;">int</span>,
                    str:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">String</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">var</span> usd:<span style="color: #0066CC;">String</span> = capturedMatch1;
    usd = usd.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;,&quot;</span>, <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #000000; font-weight: bold;">var</span> exchangeRate:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">0.853690</span>;
    <span style="color: #000000; font-weight: bold;">var</span> euro:<span style="color: #0066CC;">Number</span> = usd <span style="color: #66cc66;">*</span> exchangeRate;
    const euroSymbol:<span style="color: #0066CC;">String</span> = <span style="color: #0066CC;">String</span>.<span style="color: #0066CC;">fromCharCode</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">8364</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #b1b100;">return</span> euro.<span style="color: #006600;">toFixed</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #ff0000;">&quot; &quot;</span> + euroSymbol;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://joelhooks.com/2008/01/15/actionscript-string-replacement-and-international-currency/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/us/</creativeCommons:license>
	</item>
	</channel>
</rss>

