<?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>Randomize Everything &#187; QuickTips</title>
	<atom:link href="http://www.bartclaessens.com/category/quicktips/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bartclaessens.com</link>
	<description>And create the perfect world</description>
	<lastBuildDate>Sat, 17 Jul 2010 11:57:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>Quicktip #6: Fixing the cut off character on embedded-font-textfields</title>
		<link>http://www.bartclaessens.com/2010/01/quicktip-6-fixing-the-cut-off-character-on-embedded-font-textfields/</link>
		<comments>http://www.bartclaessens.com/2010/01/quicktip-6-fixing-the-cut-off-character-on-embedded-font-textfields/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 21:50:42 +0000</pubDate>
		<dc:creator>Bart Claessens</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[QuickTips]]></category>
		<category><![CDATA[failing width calculation]]></category>
		<category><![CDATA[font embedding]]></category>
		<category><![CDATA[quicktip]]></category>
		<category><![CDATA[textfield autosize]]></category>

		<guid isPermaLink="false">http://www.bartclaessens.com/?p=191</guid>
		<description><![CDATA[As we all know, Flash has these crazy bugs nobody ever understands. One of those is the fact that the last character of a dynamic textfield (which has been set to &#8220;AutoSize&#8221;) gets cut off when you&#8217;re using an embedded font. Up till now I still don&#8217;t understand what kind of situation leads to this [...]]]></description>
			<content:encoded><![CDATA[<p>As we all know, Flash has these crazy bugs nobody ever understands. One of those is the fact that the last character of a dynamic textfield (which has been set to &#8220;AutoSize&#8221;) gets cut off when you&#8217;re using an embedded font. Up till now I still don&#8217;t understand what kind of situation leads to this exceptional behavior. The only thing I can say is that Flash Player fails to determine the correct text length which screws up the textfield width to be shorter than it has to be.</p>
<p>Example:<br />
<div id="attachment_193" class="wp-caption alignnone" style="width: 261px"><a href="http://www.bartclaessens.com/wp-content/uploads/2010/01/blurredchars.jpg" rel="lightbox[191]"><img src="http://www.bartclaessens.com/wp-content/uploads/2010/01/blurredchars.jpg" alt="Blurred/Cut Off Characters" title="Blurred Characters" width="251" height="53" class="size-full wp-image-193" /></a><p class="wp-caption-text">Blurred/Cut Off Characters</p></div><br />
<span id="more-191"></span><br />
<br/><br />
A quicktip post wouldn&#8217;t be a quicktip post without a solution. So, here&#8217;s one of the tricks you might give a go: increase the rightMargin property of the TextField to a small value like 1 or 2.</p>

<div class="wp_syntax"><div class="code"><pre class="as3" style="font-family:monospace;">var textFormat:TextFormat = new TextFormat();
textFormat.rightMargin = 1;
&nbsp;
textField.antiAliasType = AntiAliasType.ADVANCED;
textField.gridFitType = GridFitType.SUBPIXEL;
textField.embedFonts = true;
textField.autoSize = TextFieldAutoSize.CENTER;
textField.defaultTextFormat = textFormat;
textField.setTextFormat(textFormat);</pre></div></div>

<p>Hope this helps!</p>
<div class="shr-publisher-191"></div>]]></content:encoded>
			<wfw:commentRss>http://www.bartclaessens.com/2010/01/quicktip-6-fixing-the-cut-off-character-on-embedded-font-textfields/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Quicktip #5: int is faster than uint</title>
		<link>http://www.bartclaessens.com/2009/06/quicktip-5-int-is-faster-than-uint/</link>
		<comments>http://www.bartclaessens.com/2009/06/quicktip-5-int-is-faster-than-uint/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 08:35:59 +0000</pubDate>
		<dc:creator>Bart Claessens</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[QuickTips]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[actionscript performance]]></category>
		<category><![CDATA[int]]></category>
		<category><![CDATA[Number]]></category>
		<category><![CDATA[performance gains]]></category>
		<category><![CDATA[uint]]></category>

		<guid isPermaLink="false">http://www.bartclaessens.com/?p=177</guid>
		<description><![CDATA[The past few weeks I&#8217;ve been programming a scheduling component in Flash which has to be extremely performant. Every small adaption in my code that could help with limiting the processing needs is a good adaption. Today I stumbled upon a post of Grant Skinner in which he explains that using a uint is slower [...]]]></description>
			<content:encoded><![CDATA[<p>The past few weeks I&#8217;ve been programming a scheduling component in Flash which has to be extremely performant. Every small adaption in my code that could help with limiting the processing needs is a good adaption. Today I stumbled upon a post of Grant Skinner in which he explains that using a uint is slower than a normal int. The uint&#8217;s can get five times slower than using a normal int.</p>
<p><span id="more-177"></span></p>
<p>So, what about the Number type? Well, I thought the Number type was a very slow type compared to the new int and uint but that also didn&#8217;t seem to be right!</p>
<blockquote><p>
Sho just posted a really interested article on why he won&#8217;t be using the int data type very frequently in ActionScript 3. Up until reading it, I had believed that as in other languages, there were large performance benefits to using ints and uints appropriately in AS3. Turns out that isn&#8217;t the case.</p>
<p>I did some quick testing on this, which confirm Sho&#8217;s assertion that int is only slightly faster than Number in ideal circumstances, but the results from uint were much more surprising.
</p></blockquote>
<p>Read the complete post here: <a href="http://www.gskinner.com/blog/archives/2006/06/types_in_as3_in.html">gskinner.com</a></p>
<div class="shr-publisher-177"></div>]]></content:encoded>
			<wfw:commentRss>http://www.bartclaessens.com/2009/06/quicktip-5-int-is-faster-than-uint/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quicktip #1: Casting to Number()</title>
		<link>http://www.bartclaessens.com/2008/11/quicktip-1-casting-to-number/</link>
		<comments>http://www.bartclaessens.com/2008/11/quicktip-1-casting-to-number/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 09:52:45 +0000</pubDate>
		<dc:creator>Bart Claessens</dc:creator>
				<category><![CDATA[QuickTips]]></category>
		<category><![CDATA[casting]]></category>
		<category><![CDATA[int]]></category>
		<category><![CDATA[not correct]]></category>
		<category><![CDATA[Number]]></category>
		<category><![CDATA[uint]]></category>
		<category><![CDATA[zero]]></category>

		<guid isPermaLink="false">http://www.bartclaessens.com/?p=80</guid>
		<description><![CDATA[Did you know that casting a String to a Number using the &#8216;as&#8217; operator returns 0 instead of the correct number? Use the Number() constructor to cast it correctly. The same applies for &#8216;int&#8217; and &#8216;uint&#8217;. var myNumber:String = '15'; trace&#40;&#34;My Number: &#34; + myNumber&#41;; &#160; var castedNumber:Number = myNumber as Number; trace&#40;&#34;My Number (casted [...]]]></description>
			<content:encoded><![CDATA[<p>Did you know that casting a String to a Number using the &#8216;as&#8217; operator returns 0 instead of the correct number? Use the Number() constructor to cast it correctly. The same applies for &#8216;int&#8217; and &#8216;uint&#8217;.</p>
<p><span id="more-80"></span></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> myNumber<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">'15'</span>;
<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;My Number: &quot;</span> <span style="color: #000000; font-weight: bold;">+</span> myNumber<span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> castedNumber<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = myNumber <span style="color: #0033ff; font-weight: bold;">as</span> <span style="color: #004993;">Number</span>;
<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;My Number (casted with 'as' operator): &quot;</span> <span style="color: #000000; font-weight: bold;">+</span> castedNumber<span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> betterCastedNumber<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #004993;">Number</span><span style="color: #000000;">&#40;</span>myNumber<span style="color: #000000;">&#41;</span>;
<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;My Number (casted using Number() constructor): &quot;</span> <span style="color: #000000; font-weight: bold;">+</span> betterCastedNumber<span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #009900;">// Output:</span>
<span style="color: #009900;">// My Number: 15</span>
<span style="color: #009900;">// My Number (casted with 'as' operator): 0</span>
<span style="color: #009900;">// My Number (casted using Number() constructor): 15</span></pre></div></div>

<div class="shr-publisher-80"></div>]]></content:encoded>
			<wfw:commentRss>http://www.bartclaessens.com/2008/11/quicktip-1-casting-to-number/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

