<?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>franto.com &#187; Development</title>
	<atom:link href="http://franto.com/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://franto.com</link>
	<description></description>
	<lastBuildDate>Mon, 19 Apr 2010 06:19:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Problems with latest stable Flex 4 nightly build</title>
		<link>http://franto.com/problems-with-latest-stable-flex-4-nightly-build/</link>
		<comments>http://franto.com/problems-with-latest-stable-flex-4-nightly-build/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 19:25:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[nightly build]]></category>

		<guid isPermaLink="false">http://franto.com/?p=1139</guid>
		<description><![CDATA[I have commercial project in Flex 4. That&#8217;s great I always wanted to use Flex 4 for commercial project (otherwise I didn&#8217;t have time to work with Flex 4). It was too risky, because Flex 4 is just beta 2, but application depends on custom skinning, so we have decided to implement it in Flex [...]]]></description>
			<content:encoded><![CDATA[<p>I have commercial project in Flex 4. That&#8217;s great I always wanted to use Flex 4 for commercial project (otherwise I didn&#8217;t have time to work with Flex 4). It was too risky, because Flex 4 is just beta 2, but application depends on custom skinning, so we have decided to implement it in Flex 4 together with Flash Catalyst. Workflow is not ideal (as graphics designer didn&#8217;t know about Flash catalyst), but surely it was help (at least for cutting assets <img src='http://franto.com/blog2/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ). There were few problems, but after month of development and reading some stuff and tutorials on web I want to try use latest stable nightly build. Right now it&#8217;s Flex 4.0.0.13875 from 29th of January. So I&#8217;ve downloaded and install it to Flash builder. </p>
<p>First, what I&#8217;ve found out that namespace mx was change to ns namespace. xmlns:mx=&#8221;library://ns.adobe.com/flex/halo&#8221;<br />
xmlns:ns=&#8221;library://ns.adobe.com/flex/mx&#8221;</p>
<p>some properties was renamed e.g BitmapImage resizeMode to fillMode, some properties was removed.</p>
<p>But I&#8217;ve stuck on 1 problem&#8230; from flash.* packages, there is just flash.text.*, all other flash.* packages are not inside. So e.g. I can not use MouseEvent and similar stuff</p>
<p>Does anyone know if I don&#8217;t see anything obvious? Does anyone use latest stable nightly build of Flex 4? (I&#8217;ve tried also latest nightly build Flex 13963, same problem)</p>
<p>I really want to use it, because I know, there is some important things fixed. Please let me know, if you have how to fix problem</p>
<p>Thank you very much</p>
]]></content:encoded>
			<wfw:commentRss>http://franto.com/problems-with-latest-stable-flex-4-nightly-build/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Loosing children interactivity after setting perspectiveProjection</title>
		<link>http://franto.com/loosing-children-interactivity-after-setting-perspectiveprojection/</link>
		<comments>http://franto.com/loosing-children-interactivity-after-setting-perspectiveprojection/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 09:58:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[adobe bug]]></category>
		<category><![CDATA[field of view]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[flash bug]]></category>
		<category><![CDATA[perspective projection]]></category>

		<guid isPermaLink="false">http://franto.com/?p=1133</guid>
		<description><![CDATA[My current project needs to use new native 3D in Flash Player 10. It seems so easy to use it, just set any 3d property like x,y,z or rotationX, rotationY, rotationZ and all should work perfectly. It seems so. But I have found problem and it seems it&#8217;s Flash player bug (I hope someone proves [...]]]></description>
			<content:encoded><![CDATA[<p>My current project needs to use new native 3D in Flash Player 10. It seems so easy to use it, just set any 3d property like x,y,z or rotationX, rotationY, rotationZ and all should work perfectly. It seems so. But I have found problem and it seems it&#8217;s Flash player bug (I hope someone proves me wrong <img src='http://franto.com/blog2/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ). I need to change field of view of some DisplayObject to have different perspective as it is set by  default. So I&#8217;ve done it in way</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> pp:PerspectiveProjection = <span style="color: #000000; font-weight: bold;">new</span> PerspectiveProjection<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
pp.<span style="color: #006600;">fieldOfView</span> = <span style="color: #cc66cc;">11</span>;
&nbsp;
<span style="color: #0066CC;">this</span>.<span style="color: #006600;">transform</span>.<span style="color: #006600;">perspectiveProjection</span> = pp;</pre></div></div>

<p>it&#8217;s easy and it works. But problem is, that after setting of perspectiveProjection all children interactivity (mouse click, rollovers and rollouts) stops working <img src='http://franto.com/blog2/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  and this is really big issue. I&#8217;ve tried everything I know to prevent this, but I could not make it work. So I&#8217;m trying to write this post to get help on this (if it is possible).</p>
<p>Let me know if you have similar problem and please vote for Adobe bug(s) I will post later to let Adobe fix it ASAP.</p>
<p>Some links with this issue on net:</p>
<ul>
<li><a href="http://old.nabble.com/Setting-perspectiveProjection-disable-children-interactivity-td21207809.html">http://old.nabble.com/Setting-perspectiveProjection-disable-children-interactivity-td21207809.html</a></li>
<li><a href="https://bugs.adobe.com/jira/browse/FP-2445">https://bugs.adobe.com/jira/browse/FP-2445</a></li>
<li><a href="https://bugs.adobe.com/jira/browse/FP-1609">https://bugs.adobe.com/jira/browse/FP-1609</a> This is even marked as resolved by Adobe</li>
</ul>
<p>Let me know if comments if you know anything about this problem. Thank you</p>
]]></content:encoded>
			<wfw:commentRss>http://franto.com/loosing-children-interactivity-after-setting-perspectiveprojection/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Wordpress plugin Permalinks Changer</title>
		<link>http://franto.com/wordpress-plugin-permalinks-changer/</link>
		<comments>http://franto.com/wordpress-plugin-permalinks-changer/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 07:07:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress plugin]]></category>

		<guid isPermaLink="false">http://franto.com/?p=1129</guid>
		<description><![CDATA[When you want to change your permalinks structure in Wordpress, it's easy way if your are Wordpress semi-advance user. But there are also Wordpress Newbies, which want to change Wordpress permalinks structure as well. I've created small wordpress plugin called Permalinks Changer, which helps you to change you permalinks structure in more friendly way]]></description>
			<content:encoded><![CDATA[<div class='series_toc'><h3>Table of contents for wordpress</h3><ol><li>Wordpress plugin Permalinks Changer</li></ol></div> <p>When you want to change your permalinks structure in Wordpress,there is easy way if your are Wordpress semi-advance user. But there are also Wordpress Newbies, which want to change Wordpress permalinks structure as well. I&#8217;ve created small wordpress plugin called Permalinks Changer, which helps you to change you permalinks structure in more friendly way. This was implemented as help to one of my friend in some private interner marketer forum. Now there are just 3 simple possibilities of permalinks structure:</p>
<ul>
<li>use your post name in URLs</li>
<li>use category and post name in URLs</li>
<li>reset to default permalinks structure</li>
</ul>
<p>If you have any idea how to make life easier for Wordpress newbies, please leave a comment with your suggestion.</p>
<p><a href="http://franto.com/download/wp/permalinks-changer.zip">Download Wordpress Plugin Permalinks Changer</a></p>
 <div class='series_links'> </div>]]></content:encoded>
			<wfw:commentRss>http://franto.com/wordpress-plugin-permalinks-changer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Numeric sorting of Flex DataGridColumn</title>
		<link>http://franto.com/numeric-sorting-of-flex-datagridcolumn/</link>
		<comments>http://franto.com/numeric-sorting-of-flex-datagridcolumn/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 12:18:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flex Tips]]></category>

		<guid isPermaLink="false">http://franto.com/?p=1123</guid>
		<description><![CDATA[This is quick solution for Flex coders. If you want to sort column in DataGrid, default sorting is sorted by String and not Number. If you have just one numeric column, you can create custom sort function and set sortCompareFunction for given DataGridColumn. If you have more such columns and you dataProvider is ArrayCollection which consists of many object, better solution is override DataGridColumn and implement compareFunction inside this class.]]></description>
			<content:encoded><![CDATA[<div class='series_toc'><h3>Table of contents for flex-tips</h3><ol><li><a href='http://franto.com/problem-with-xml-attributes-in-as3-0/' title='Problem with XML attributes in AS3.0'>Problem with XML attributes in AS3.0</a></li><li><a href='http://franto.com/unable-to-export-swc-oem/' title='Unable to export SWC oem'>Unable to export SWC oem</a></li><li>Numeric sorting of Flex DataGridColumn</li></ol></div> <p>This is quick example for <strong>Numeric sorting of Flex DataGrid columns</strong>. If you want to sort column in DataGrid, default sorting is sorted by String and not by Number. If you have just one numeric column, you may create custom sort function and set <strong>sortCompareFunction</strong> for given <strong>DataGridColumn</strong>. If you have more such columns and your dataProvider is <strong>ArrayCollection</strong>, which consists of many objects, better solution is override <strong>DataGridColumn</strong> and implement compare function inside this class. Here is class</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package com.<span style="color: #006600;">flexets</span>.<span style="color: #006600;">components</span>.<span style="color: #006600;">dataGridClasses</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">dataGridClasses</span>.<span style="color: #006600;">DataGridColumn</span>;
	<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">utils</span>.<span style="color: #006600;">ObjectUtil</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> NumericDataGridColumn <span style="color: #0066CC;">extends</span> DataGridColumn
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> const NUMERIC:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;N&quot;</span>;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> NumericDataGridColumn<span style="color: #66cc66;">&#40;</span>columnName:<span style="color: #0066CC;">String</span>=<span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</span>columnName<span style="color: #66cc66;">&#41;</span>;
			initCompare<span style="color: #66cc66;">&#40;</span>NUMERIC<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">function</span> initCompare<span style="color: #66cc66;">&#40;</span>numeric:<span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>numeric == NUMERIC<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
				sortCompareFunction = numericCompare;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		* Pull the numbers from the objects and call the implementation. TAKEN FROM mx.collections.SortField
		*/</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> numericCompare<span style="color: #66cc66;">&#40;</span>a:<span style="color: #0066CC;">Object</span>, b:<span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">int</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> fa:<span style="color: #0066CC;">Number</span>;
			<span style="color: #0066CC;">try</span>
			<span style="color: #66cc66;">&#123;</span>
				fa = dataField == <span style="color: #000000; font-weight: bold;">null</span> ? <span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>a<span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>a<span style="color: #66cc66;">&#91;</span>dataField<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #0066CC;">catch</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">error</span>:<span style="color: #0066CC;">Error</span><span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
			<span style="color: #000000; font-weight: bold;">var</span> fb:<span style="color: #0066CC;">Number</span>;
			<span style="color: #0066CC;">try</span>
			<span style="color: #66cc66;">&#123;</span>
				fb = dataField == <span style="color: #000000; font-weight: bold;">null</span> ? <span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>b<span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>b<span style="color: #66cc66;">&#91;</span>dataField<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #0066CC;">catch</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">error</span>:<span style="color: #0066CC;">Error</span><span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
			<span style="color: #b1b100;">return</span> ObjectUtil.<span style="color: #006600;">numericCompare</span><span style="color: #66cc66;">&#40;</span>fa, fb<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>and then just use NumericDataGridColumn  in your mxml in DataGrid like this</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGrid</span> id=<span style="color: #ff0000;">&quot;myDG&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;100%&quot;</span> dataProvider=<span style="color: #ff0000;">&quot;{myDataProvider}&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;id&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;dataGridClasses:NumericDataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;order&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;title&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;dataGridClasses:NumericDataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;price&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:DataGrid</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Enjoy this little Flex tip.</p>
 <div class='series_links'><a href='http://franto.com/unable-to-export-swc-oem/' title='Unable to export SWC oem'>Previous in series</a> </div>]]></content:encoded>
			<wfw:commentRss>http://franto.com/numeric-sorting-of-flex-datagridcolumn/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>$1000 for Wordpress plugin</title>
		<link>http://franto.com/1000-for-wordpress-plugin/</link>
		<comments>http://franto.com/1000-for-wordpress-plugin/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 07:13:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[web analytics]]></category>
		<category><![CDATA[wordpress plugin]]></category>

		<guid isPermaLink="false">http://franto.com/?p=1106</guid>
		<description><![CDATA[If you are Wordpress plugin developer you have nice chance to earn $1000. It's for <a href="http://franto.com/go/getclicky">GetClicky Web Analytics</a> site. It is site similar to Google Analytics, but their data are realtime, so you can really see who is on your site and which content is seen by your visitors currently. It's very useful web analytics site and I'm using it for tracking my sites. But get back to <a href="http://franto.com/go/getclicky">GetClicky</a> Wordpress Plugin.]]></description>
			<content:encoded><![CDATA[<p>If you are Wordpress plugin developer you have nice chance to earn $1000. It&#8217;s for <a href="http://franto.com/go/getclicky/">GetClicky Web Analytics</a> site. It is site similar to Google Analytics, but their data are realtime, so you can really see who is on your site and which content is seen by your visitors currently. It&#8217;s very useful web analytics site and I&#8217;m using it for tracking my sites. But get back to <a href="http://franto.com/go/getclicky/">GetClicky</a> Wordpress Plugin.</p>
<p>They need to help with development and they are willing to pay you $1000. Here is quotation form their site:</p>
<div style="font-style:italics;color:#888888;font-size:14px;font-family:Arial">Our WordPress plugin seems to have serious compatibility issues with 2.7 and beyond. It&#8217;s also lacking a couple of features we wish that it had. We find the WP API very difficult to work with and wish to never lay eyes on it again. Therefore, we are offering $1,000 to a qualified WP plugin developer to make the plugin of our dreams.</p>
<p>You need to be very experienced with the WP API, and must have developed at least one major (semi-popular) plugin, or several more minor ones. You also must be the type of person who believes code is a beautiful piece of art, because if there&#8217;s one thing that gets my goat, it&#8217;s messy code.&#8221;</p></div>
<p>Read more about it: <a href="http://getclicky.com/blog/178/1000-for-a-new-clicky-wordpress-plugin">$1000 for Wordpress plugin</a>. And if you are not Wordpress plugin developer you may be interested in tracking you site with <a href="http://franto.com/go/getclicky/">realtime web analytics by GetClicky</a>. It&#8217;s completly free for one site and it&#8217;s very affordable if you want to <strong>track more sites in realtime</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://franto.com/1000-for-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Goodbye FlashDen, hello ActiveDen</title>
		<link>http://franto.com/goodbye-flashden-hello-activeden/</link>
		<comments>http://franto.com/goodbye-flashden-hello-activeden/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 20:04:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://franto.com/?p=1095</guid>
		<description><![CDATA[I've found out today, that there is no longer <strong>FlashDen.net</strong>, but instead there is new site in <strong>Envato network</strong> called <a href="http://franto.com/go/activeden.net"><strong>ActiveDen</strong></a>. It's same site, but Adobe has asked Envato to change the name because "Flash" is registered trademark of Adobe. And there are also Flex files on ActiveDen, so there are no more just pure Flash files, so it's maybe better name now.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve found out today, that there is no longer <strong>FlashDen.net</strong>, but instead there is new site in <strong>Envato network</strong> called <a href="http://franto.com/go/activeden.net"><strong>ActiveDen</strong></a>. It&#8217;s same site, but Adobe has asked Envato to change the name because &#8220;Flash&#8221; is registered trademark of Adobe. And there are also Flex files on ActiveDen, so there are no more just pure Flash files, so it&#8217;s maybe better name now.</p>
<h3><a href="http://franto.com/go/activeden.net">Goodbye FlashDen, hello ActiveDen</a></h3>
]]></content:encoded>
			<wfw:commentRss>http://franto.com/goodbye-flashden-hello-activeden/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Major update of Goalscape AIR application</title>
		<link>http://franto.com/major-update-ofr-goalscape-air-application/</link>
		<comments>http://franto.com/major-update-ofr-goalscape-air-application/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 20:06:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Goalscape]]></category>

		<guid isPermaLink="false">http://franto.com/?p=1081</guid>
		<description><![CDATA[This friday we have released <strong><a href="http://www.goalscape.com/blog/major-update-out-today">major update for Goalscape AIR application</a></strong>. It is project we (me with Tomas as <a href="http://www.flexets.com">Flexets company</a>) have been working on for more than year. If you are not aware of Goalscape application please look at intro video. But in one sentence it's <strong>Goal Management Software</strong>.]]></description>
			<content:encoded><![CDATA[<p>This friday we have released <strong><a href="http://www.goalscape.com/blog/major-update-out-today">major update for Goalscape AIR application</a></strong>. It is project we (me with Tomas as <a href="http://www.flexets.com">Flexets company</a>) have been working on for more than year. If you are not aware of <strong>Goalscape</strong> application please look at intro video. But in one sentence it&#8217;s <strong>Goal Management Software</strong>.</p>
<p><object width="400" height="225"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=6497482&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=a0a3a8&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=6497482&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=a0a3a8&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object></p>
<p>Here is list of main features in this update:</p>
<ul>
<li><strong>Search function</strong></li>
<li><strong>Adding and naming goals</strong></li>
<li><strong>Icons for common functions</strong></li>
<li><strong>Language support</strong></li>
<li><strong>Notes text</strong></li>
<li><strong>Attachments</strong></li>
</ul>
<p>If you are interested in details go and read about them here: <strong><a href="http://www.goalscape.com/blog/major-update-out-today">Major update for Goalscape AIR application</a></strong> and <strong><a href="http://www.goalscape.com/goalscape-download">download Goalscape</a></strong> (AIR application). You have 1 month free trial and then it&#8217;s just 45€ one time payment which include all future updates.</p>
<p>If you have any questions about <strong><a href="http://www.goalscape.com">Goalscape</a></strong> ask in comments, I can answer them in comments. Even if you install <strong><a href="http://www.goalscape.com">Goalscape</a></strong> and want to see there some features, let me know and we will consider to add them to <strong><a href="http://www.goalscape.com">Goalscape</a></strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://franto.com/major-update-ofr-goalscape-air-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why my sites were not indexed by Google?</title>
		<link>http://franto.com/why-my-sites-were-not-indexed-by-google/</link>
		<comments>http://franto.com/why-my-sites-were-not-indexed-by-google/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 19:12:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[My Sites]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://franto.com/?p=1070</guid>
		<description><![CDATA[Few months ago I've created site <strong><a href="http://filmcomposers.info" title="Movie Soundtracks Composers">http://filmcomposers.info</a></strong> about <strong>Movie Soundtracks Composers</strong>, because I like movie soundtracks and music composing (orchestral) (I really love Hans Zimmer work). But site is still not indexed by google...]]></description>
			<content:encoded><![CDATA[<p>Few months ago I&#8217;ve created site <strong><a href="http://filmcomposers.info" title="Movie Soundtracks Composers">http://filmcomposers.info</a></strong> about <strong>Movie Soundtracks Composers</strong>, because I like movie soundtracks and music composing (orchestral) (I really love Hans Zimmer work). But site is still not indexed by google. I was thinking, that&#8217;s because almost all content is done by <strong><a href="http://franto.com/wordpress-as-cms/">Wordpress plugin Pods</a></strong> and there are no posts or pages and just this site is linking to the site <strong><a href="http://filmcomposers.info" title="Movie Soundtracks Composers">http://filmcomposers.info</a></strong>. So I&#8217;ve submitted site to Google Webmasters tools, still nothing, I have check if there is no robots.txt file or if inside of that file are search spiders disalloved. I didn&#8217;t find anything. Buuut, yes, I&#8217;m such a fool <img src='http://franto.com/blog2/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  It&#8217;s Wordpress privacy setting: <strong>I would like my blog to be visible to everyone, including search engines (like Google, Sphere, Technorati) and archivers</strong> or <strong>I would like to block search engines, but allow normal visitors</strong>. Yes, that&#8217;s why google can&#8217;t indexed my site <img src='http://franto.com/blog2/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  This option adds meta tag into page header:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;meta name=&quot;robots&quot; content=&quot;noindex, nofollow&quot;&gt;</pre></div></div>

<p>So if you have same problems and you have site based on <strong>Wordpress</strong>, check in your Admin section <strong>Settings > Privacy</strong> or check html source code for robots meta tag in header.</p>
<p>After this discovery yesterday I&#8217;ve found out that even <strong><a href="http://franto.com">franto.com</a></strong> has same settings and it&#8217;s not indexed by google from time I&#8217;ve changed hosting provider few months ago. So I have rather changed all my other sites and they are all ok <img src='http://franto.com/blog2/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I think I need to create some AIR app for checking such SEO problems&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://franto.com/why-my-sites-were-not-indexed-by-google/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Text Layout Engine: TruncationOptions</title>
		<link>http://franto.com/text-layout-engine-truncationoptions/</link>
		<comments>http://franto.com/text-layout-engine-truncationoptions/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 12:46:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Text Layout Engine]]></category>

		<guid isPermaLink="false">http://franto.com/?p=1061</guid>
		<description><![CDATA[This is same example as yesterday (<strong><a href="http://franto.com/text-layout-engine-fit-text-into-rectangle/">Fit text in rectangle with Text Layout Engine</a></strong>), but I've added one more switch. You can decide if you want use <strong>TruncationOptions</strong> or not. Reason why I want to show this to you is that it works differently. I do not know if this is feature or bug, but try to tell me your opinion in comments.]]></description>
			<content:encoded><![CDATA[<div class='series_toc'><h3>Table of contents for Text Layout Engine</h3><ol><li><a href='http://franto.com/text-layout-engine-in-flex-3/' title='Text Layout Engine in Flex 3'>Text Layout Engine in Flex 3</a></li><li><a href='http://franto.com/text-layout-engine-fit-text-into-rectangle/' title='Text Layout Engine: Fit text into rectangle'>Text Layout Engine: Fit text into rectangle</a></li><li>Text Layout Engine: TruncationOptions</li></ol></div> <p>This is same example as yesterday (<strong><a href="http://franto.com/text-layout-engine-fit-text-into-rectangle/">Fit text in rectangle with Text Layout Engine</a></strong>), but I&#8217;ve added one more switch. You can decide if you want use <strong>TruncationOptions</strong> or not. Reason why I want to show this to you is that it works differently. I do not know if this is feature or bug, but try to tell me your opinion in comments. When I use TruncationOptions in this way:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> truncationOptions<span style="color: #000000; font-weight: bold;">:</span>TruncationOptions = <span style="color: #0033ff; font-weight: bold;">new</span> TruncationOptions<span style="color: #000000;">&#40;</span><span style="color: #990000;">'...'</span>,<span style="color: #000000; font-weight:bold;">3</span><span style="color: #000000;">&#41;</span>;
factory.truncationOptions = truncationOptions;</pre></div></div>

<p>all works nice and text is fitted into rectangle. But when I do not include truncation last line of text is out of the rectangle if any pixel line of text line is inside rectangle. Maybe there is some other property which can handle this situation, but I&#8217;m not really aware of it. Do you know about such property?</p>
<p>Try it in this example:<br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
                        id="TextLayoutEngineExamples" width="100%" height="400"
                        codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
                        <param name="movie" value="http://franto.com/uploads/examples/textLayoutEngine/fit2/TextLayoutEngineExamples.swf" />
                        <param name="quality" value="high" />
                        <param name="bgcolor" value="#333333" />
                        <param name="allowScriptAccess" value="sameDomain" />
                        <embed src="http://franto.com/uploads/examples/textLayoutEngine/fit2/TextLayoutEngineExamples.swf" quality="high" bgcolor="#333333"
                                width="100%" height="400" name="TextLayoutEngineExamples" align="middle"
                                play="true"
                                loop="false"
                                quality="high"
                                allowScriptAccess="sameDomain"
                                type="application/x-shockwave-flash"
                                pluginspage="http://www.adobe.com/go/getflashplayer">
                        </embed>
        </object>
</p>
<p>and here is source code:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span>xml <span style="color: #004993;">version</span>=<span style="color: #990000;">&quot;1.0&quot;</span> encoding=<span style="color: #990000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>Application xmlns<span style="color: #000000; font-weight: bold;">:</span>mx=<span style="color: #990000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> layout=<span style="color: #990000;">&quot;absolute&quot;</span> applicationComplete=<span style="color: #990000;">&quot;fit()&quot;</span>
	<span style="color: #004993;">backgroundColor</span>=<span style="color: #990000;">&quot;0x333333&quot;</span> <span style="color: #004993;">color</span>=<span style="color: #990000;">&quot;0xffffff&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>Style <span style="color: #004993;">source</span>=<span style="color: #990000;">&quot;styles/fonts.css&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>RadioButtonGroup id=<span style="color: #990000;">&quot;radioGroup&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>VBox <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;100%&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>HBox<span style="color: #000000; font-weight: bold;">&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>RadioButton id=<span style="color: #990000;">&quot;radioButton1&quot;</span> label=<span style="color: #990000;">&quot;Don't truncate&quot;</span> <span style="color: #004993;">value</span>=<span style="color: #990000;">&quot;false&quot;</span> group=<span style="color: #990000;">&quot;{radioGroup}&quot;</span>	selected=<span style="color: #990000;">&quot;true&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>RadioButton id=<span style="color: #990000;">&quot;radioButton2&quot;</span> label=<span style="color: #990000;">&quot;Truncate&quot;</span> <span style="color: #004993;">value</span>=<span style="color: #990000;">&quot;true&quot;</span> group=<span style="color: #990000;">&quot;{radioGroup}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;/</span>mx<span style="color: #000000; font-weight: bold;">:</span>HBox<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>HBox <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>Label <span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;Text:&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>TextInput id=<span style="color: #990000;">&quot;txtInput&quot;</span> <span style="color: #004993;">color</span>=<span style="color: #990000;">&quot;0x000000&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> <span style="color: #004993;">change</span>=<span style="color: #990000;">&quot;fit()&quot;</span> <span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;Text Layout Engine: Fit Text into Rectangle&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;/</span>mx<span style="color: #000000; font-weight: bold;">:</span>HBox<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>HBox<span style="color: #000000; font-weight: bold;">&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>Label <span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;Font Size:&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>HSlider id=<span style="color: #990000;">&quot;fsSlider&quot;</span> liveDragging=<span style="color: #990000;">&quot;true&quot;</span> minimum=<span style="color: #990000;">&quot;6&quot;</span> maximum=<span style="color: #990000;">&quot;50&quot;</span> snapInterval=<span style="color: #990000;">&quot;1&quot;</span> <span style="color: #004993;">value</span>=<span style="color: #990000;">&quot;14&quot;</span>
				<span style="color: #004993;">change</span>=<span style="color: #990000;">&quot;fit()&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;/</span>mx<span style="color: #000000; font-weight: bold;">:</span>HBox<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>HBox<span style="color: #000000; font-weight: bold;">&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>Label <span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;Text Width:&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>HSlider id=<span style="color: #990000;">&quot;wSlider&quot;</span> liveDragging=<span style="color: #990000;">&quot;true&quot;</span> minimum=<span style="color: #990000;">&quot;0&quot;</span> maximum=<span style="color: #990000;">&quot;500&quot;</span> snapInterval=<span style="color: #990000;">&quot;1&quot;</span> <span style="color: #004993;">value</span>=<span style="color: #990000;">&quot;100&quot;</span>
				<span style="color: #004993;">change</span>=<span style="color: #990000;">&quot;fit()&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;/</span>mx<span style="color: #000000; font-weight: bold;">:</span>HBox<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>HBox<span style="color: #000000; font-weight: bold;">&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>Label <span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;Text Height:&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>HSlider id=<span style="color: #990000;">&quot;hSlider&quot;</span> liveDragging=<span style="color: #990000;">&quot;true&quot;</span> minimum=<span style="color: #990000;">&quot;0&quot;</span> maximum=<span style="color: #990000;">&quot;500&quot;</span> snapInterval=<span style="color: #990000;">&quot;1&quot;</span> <span style="color: #004993;">value</span>=<span style="color: #990000;">&quot;100&quot;</span>
				<span style="color: #004993;">change</span>=<span style="color: #990000;">&quot;fit()&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;/</span>mx<span style="color: #000000; font-weight: bold;">:</span>HBox<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>HBox<span style="color: #000000; font-weight: bold;">&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>Label <span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;Fit font to do not truncate text:&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>CheckBox id=<span style="color: #990000;">&quot;chbTruncate&quot;</span> selected=<span style="color: #990000;">&quot;false&quot;</span> <span style="color: #004993;">change</span>=<span style="color: #990000;">&quot;fit()&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;/</span>mx<span style="color: #000000; font-weight: bold;">:</span>HBox<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>HBox<span style="color: #000000; font-weight: bold;">&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>Label <span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;isTruncated?&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>Canvas <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;20&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;20&quot;</span> <span style="color: #004993;">backgroundColor</span>=<span style="color: #990000;">&quot;0xff0000&quot;</span> 
				<span style="color: #004993;">visible</span>=<span style="color: #990000;">&quot;{!isTruncated}&quot;</span> includeInLayout=<span style="color: #990000;">&quot;{!isTruncated}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>Canvas <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;20&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;20&quot;</span> <span style="color: #004993;">backgroundColor</span>=<span style="color: #990000;">&quot;0x00aa00&quot;</span> 
				<span style="color: #004993;">visible</span>=<span style="color: #990000;">&quot;{isTruncated}&quot;</span> includeInLayout=<span style="color: #990000;">&quot;{isTruncated}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;/</span>mx<span style="color: #000000; font-weight: bold;">:</span>HBox<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>UIComponent id=<span style="color: #990000;">&quot;ui&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;100%&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">&lt;/</span>mx<span style="color: #000000; font-weight: bold;">:</span>UIComponent<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;/</span>mx<span style="color: #000000; font-weight: bold;">:</span>VBox<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>Script<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;!</span><span style="color: #000000;">&#91;</span>CDATA<span style="color: #000000;">&#91;</span>
			<span style="color: #0033ff; font-weight: bold;">import</span> assets.TLEAssets;
			<span style="color: #0033ff; font-weight: bold;">import</span> flashx.textLayout.factory.TruncationOptions;
			<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span>.engine.Kerning;
			<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span>.engine.FontLookup;
			<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span>.engine.RenderingMode;
			<span style="color: #0033ff; font-weight: bold;">import</span> flashx.textLayout.formats.TextLayoutFormat;
			<span style="color: #0033ff; font-weight: bold;">import</span> flashx.textLayout.factory.StringTextLineFactory;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> sprite<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span>;
&nbsp;
			<span style="color: #000000;">&#91;</span>Bindable<span style="color: #000000;">&#93;</span> <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> isTruncated<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> fit<span style="color: #000000;">&#40;</span>fs<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span> = <span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span>, cnt<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span> = <span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
	        <span style="color: #000000;">&#123;</span>
	        	<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>sprite == <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span>
	        	<span style="color: #000000;">&#123;</span>
	        		sprite = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	        		ui.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>sprite<span style="color: #000000;">&#41;</span>;
	        	<span style="color: #000000;">&#125;</span>
	        	<span style="color: #0033ff; font-weight: bold;">while</span> <span style="color: #000000;">&#40;</span>sprite.<span style="color: #004993;">numChildren</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span>
	        	<span style="color: #000000;">&#123;</span>
	        		sprite.<span style="color: #004993;">removeChildAt</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span>;
	        	<span style="color: #000000;">&#125;</span>
	            <span style="color: #6699cc; font-weight: bold;">var</span> factory<span style="color: #000000; font-weight: bold;">:</span>StringTextLineFactory = <span style="color: #0033ff; font-weight: bold;">new</span> StringTextLineFactory<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
	            factory.compositionBounds = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Rectangle</span><span style="color: #000000;">&#40;</span> <span style="color: #000000; font-weight:bold;">10</span>, <span style="color: #000000; font-weight:bold;">10</span>, wSlider.<span style="color: #004993;">value</span>, hSlider.<span style="color: #004993;">value</span> <span style="color: #000000;">&#41;</span>;
&nbsp;
	           	<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>fs == <span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span>
	           		fs = fsSlider.<span style="color: #004993;">value</span>;
&nbsp;
	            <span style="color: #6699cc; font-weight: bold;">var</span> format<span style="color: #000000; font-weight: bold;">:</span>TextLayoutFormat = <span style="color: #0033ff; font-weight: bold;">new</span> TextLayoutFormat<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	            format.fontFamily = <span style="color: #990000;">&quot;Verdana, _sans&quot;</span>;
	            format.<span style="color: #004993;">fontSize</span> = fs;
	            format.<span style="color: #004993;">color</span> = 0x000000;
	            format.textAlpha = .9;
	            format.<span style="color: #004993;">kerning</span> = Kerning.ON;
	            format.renderingMode = RenderingMode.CFF;
				format.fontLookup = FontLookup.EMBEDDED_CFF;
	            factory.spanFormat = format;
&nbsp;
				<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>radioGroup.selectedValue == <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>
				<span style="color: #000000;">&#123;</span>
					<span style="color: #6699cc; font-weight: bold;">var</span> truncationOptions<span style="color: #000000; font-weight: bold;">:</span>TruncationOptions = <span style="color: #0033ff; font-weight: bold;">new</span> TruncationOptions<span style="color: #000000;">&#40;</span><span style="color: #990000;">'...'</span>,<span style="color: #000000; font-weight:bold;">3</span><span style="color: #000000;">&#41;</span>;
					factory.truncationOptions = truncationOptions;
				<span style="color: #000000;">&#125;</span>				
&nbsp;
	            factory.<span style="color: #004993;">text</span> = txtInput.<span style="color: #004993;">text</span>;
	            factory.createTextLines<span style="color: #000000;">&#40;</span> useTextLines <span style="color: #000000;">&#41;</span>;
&nbsp;
	            isTruncated = factory.isTruncated;
&nbsp;
	            <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>chbTruncate.selected <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> isTruncated <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> fs <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight:bold;">10</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> cnt <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight:bold;">50</span><span style="color: #000000;">&#41;</span>
	            <span style="color: #000000;">&#123;</span>
	            	fs<span style="color: #000000; font-weight: bold;">--</span>;
	            	cnt<span style="color: #000000; font-weight: bold;">++</span>;
	            	fit<span style="color: #000000;">&#40;</span>fs, cnt<span style="color: #000000;">&#41;</span>;
	            <span style="color: #000000;">&#125;</span>
&nbsp;
	            sprite.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">clear</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	            sprite.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">beginFill</span><span style="color: #000000;">&#40;</span>0x555555,.5<span style="color: #000000;">&#41;</span>;
	            sprite.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">drawRect</span><span style="color: #000000;">&#40;</span> <span style="color: #000000; font-weight:bold;">10</span>,<span style="color: #000000; font-weight:bold;">10</span>, wSlider.<span style="color: #004993;">value</span>, hSlider.<span style="color: #004993;">value</span> <span style="color: #000000;">&#41;</span>;
	            sprite.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">endFill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	        <span style="color: #000000;">&#125;</span>
&nbsp;
	        <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> useTextLines<span style="color: #000000;">&#40;</span> line<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">DisplayObject</span> <span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
	        <span style="color: #000000;">&#123;</span>
	            <span style="color: #6699cc; font-weight: bold;">var</span> displayObject<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">DisplayObject</span> = sprite.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span> line <span style="color: #000000;">&#41;</span>;
	        <span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;/</span>mx<span style="color: #000000; font-weight: bold;">:</span>Script<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>mx<span style="color: #000000; font-weight: bold;">:</span>Application<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>Let me know, what you think about it&#8230;</p>
<p><strong>P.S.</strong> I have other example with use <strong>TextFlow</strong> component with <strong>TextFlowTextLineFactory</strong> (graphics included within the text) instead of using <strong>StringTextLineFactory</strong>. I will post it later today or tommorow. Stay tuned</p>
 <div class='series_links'><a href='http://franto.com/text-layout-engine-fit-text-into-rectangle/' title='Text Layout Engine: Fit text into rectangle'>Previous in series</a> </div>]]></content:encoded>
			<wfw:commentRss>http://franto.com/text-layout-engine-truncationoptions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Text Layout Engine: Fit text into rectangle</title>
		<link>http://franto.com/text-layout-engine-fit-text-into-rectangle/</link>
		<comments>http://franto.com/text-layout-engine-fit-text-into-rectangle/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 11:15:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Text Layout Engine]]></category>

		<guid isPermaLink="false">http://franto.com/?p=1040</guid>
		<description><![CDATA[This is first example in serie of examples of showcase how to use <strong>Text Layout Engine</strong> (mainly for Flex 3). 

<strong>Here is quick description:</strong> I need to fit text in rectangle (need it for our <strong><a href="http://www.goalscape.com">Goalscape</a></strong> project). I want to be able to change width, height, font size and text of course.]]></description>
			<content:encoded><![CDATA[<div class='series_toc'><h3>Table of contents for Text Layout Engine</h3><ol><li><a href='http://franto.com/text-layout-engine-in-flex-3/' title='Text Layout Engine in Flex 3'>Text Layout Engine in Flex 3</a></li><li>Text Layout Engine: Fit text into rectangle</li><li><a href='http://franto.com/text-layout-engine-truncationoptions/' title='Text Layout Engine: TruncationOptions'>Text Layout Engine: TruncationOptions</a></li></ol></div> <p>This is first example in serie of examples of showcase how to use <strong>Text Layout Engine</strong> (mainly for Flex 3). </p>
<p><strong>Here is quick description:</strong> I need to fit text in rectangle (need it for our <strong><a href="http://www.goalscape.com">Goalscape</a></strong> project). I want to be able to change width, height, font size and text of course. In <strong>Text Layout Engine</strong> this can be done very easily. All you need to do is create correct format for your text, and set <strong>compositionBounds</strong> for text line factory. I will use <strong>StringTextLineFactory</strong> class, which provides a simple way to create <strong>TextLines</strong> from a string. Even I add also <strong>TruncationOptions</strong>, which specifies options for limiting the number of lines of text created by a text line factory and for indicating when lines have been left out.  I&#8217;m using <strong>TruncationOptions</strong>, because I want use maximum of 3 lines and if text is too long I want add &#8230; at the end. This is done automatically in <strong>Text Layout Engine</strong> and I do not need to implement by myself.</p>
<p>Only problem I see, that result .swf file size is over 500kB even builded as Release version (Debug version has 692kB). It&#8217;s because of <strong>Text Layout Engine</strong> and <strong>Flex framework</strong> are included in .swf. But because I will use it in AIR application, it&#8217;s ok for me.</p>
<p>I have created Flash demo for you, but it works just in Flash Player 10, because of Text Layout Engine. Just play with sliders and write your custom text to see effect. In case text will be truncating you will see <span style="color:#008800">green square</span>, otherwise there will be <span style="color:#aa0000">red square</span> (not truncated).<br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
                        id="TextLayoutEngineExamples" width="100%" height="350"
                        codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
                        <param name="movie" value="http://franto.com/uploads/examples/textLayoutEngine/fit/TextLayoutEngineExamples.swf" />
                        <param name="quality" value="high" />
                        <param name="bgcolor" value="#869ca7" />
                        <param name="allowScriptAccess" value="sameDomain" />
                        <embed src="http://franto.com/uploads/examples/textLayoutEngine/fit/TextLayoutEngineExamples.swf" quality="high" bgcolor="#869ca7"
                                width="100%" height="350" name="TextLayoutEngineExamples" align="middle"
                                play="true"
                                loop="false"
                                quality="high"
                                allowScriptAccess="sameDomain"
                                type="application/x-shockwave-flash"
                                pluginspage="http://www.adobe.com/go/getflashplayer">
                        </embed>
        </object>
</p>
<p>And this is source code</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span>xml <span style="color: #004993;">version</span>=<span style="color: #990000;">&quot;1.0&quot;</span> encoding=<span style="color: #990000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>Application xmlns<span style="color: #000000; font-weight: bold;">:</span>mx=<span style="color: #990000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> layout=<span style="color: #990000;">&quot;absolute&quot;</span> applicationComplete=<span style="color: #990000;">&quot;fit()&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>Style <span style="color: #004993;">source</span>=<span style="color: #990000;">&quot;styles/fonts.css&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>VBox <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;100%&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>HBox <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>Label <span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;Text:&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>TextInput id=<span style="color: #990000;">&quot;txtInput&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> <span style="color: #004993;">change</span>=<span style="color: #990000;">&quot;fit()&quot;</span> <span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;Text Layout Engine: Fit Text into Rectangle&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;/</span>mx<span style="color: #000000; font-weight: bold;">:</span>HBox<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>HBox<span style="color: #000000; font-weight: bold;">&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>Label <span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;Font Size:&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>HSlider id=<span style="color: #990000;">&quot;fsSlider&quot;</span> liveDragging=<span style="color: #990000;">&quot;true&quot;</span> minimum=<span style="color: #990000;">&quot;6&quot;</span> maximum=<span style="color: #990000;">&quot;50&quot;</span> snapInterval=<span style="color: #990000;">&quot;1&quot;</span> <span style="color: #004993;">value</span>=<span style="color: #990000;">&quot;14&quot;</span>
				<span style="color: #004993;">change</span>=<span style="color: #990000;">&quot;fit()&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;/</span>mx<span style="color: #000000; font-weight: bold;">:</span>HBox<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>HBox<span style="color: #000000; font-weight: bold;">&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>Label <span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;Text Width:&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>HSlider id=<span style="color: #990000;">&quot;wSlider&quot;</span> liveDragging=<span style="color: #990000;">&quot;true&quot;</span> minimum=<span style="color: #990000;">&quot;0&quot;</span> maximum=<span style="color: #990000;">&quot;500&quot;</span> snapInterval=<span style="color: #990000;">&quot;1&quot;</span> <span style="color: #004993;">value</span>=<span style="color: #990000;">&quot;100&quot;</span>
				<span style="color: #004993;">change</span>=<span style="color: #990000;">&quot;fit()&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;/</span>mx<span style="color: #000000; font-weight: bold;">:</span>HBox<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>HBox<span style="color: #000000; font-weight: bold;">&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>Label <span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;Text Height:&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>HSlider id=<span style="color: #990000;">&quot;hSlider&quot;</span> liveDragging=<span style="color: #990000;">&quot;true&quot;</span> minimum=<span style="color: #990000;">&quot;0&quot;</span> maximum=<span style="color: #990000;">&quot;500&quot;</span> snapInterval=<span style="color: #990000;">&quot;1&quot;</span> <span style="color: #004993;">value</span>=<span style="color: #990000;">&quot;100&quot;</span>
				<span style="color: #004993;">change</span>=<span style="color: #990000;">&quot;fit()&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;/</span>mx<span style="color: #000000; font-weight: bold;">:</span>HBox<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>HBox<span style="color: #000000; font-weight: bold;">&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>Label <span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;isTruncated?&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>Canvas <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;20&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;20&quot;</span> <span style="color: #004993;">backgroundColor</span>=<span style="color: #990000;">&quot;0xff0000&quot;</span> 
				<span style="color: #004993;">visible</span>=<span style="color: #990000;">&quot;{!isTruncated}&quot;</span> includeInLayout=<span style="color: #990000;">&quot;{!isTruncated}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>Canvas <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;20&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;20&quot;</span> <span style="color: #004993;">backgroundColor</span>=<span style="color: #990000;">&quot;0x00aa00&quot;</span> 
				<span style="color: #004993;">visible</span>=<span style="color: #990000;">&quot;{isTruncated}&quot;</span> includeInLayout=<span style="color: #990000;">&quot;{isTruncated}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;/</span>mx<span style="color: #000000; font-weight: bold;">:</span>HBox<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>UIComponent id=<span style="color: #990000;">&quot;ui&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;100%&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">&lt;/</span>mx<span style="color: #000000; font-weight: bold;">:</span>UIComponent<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;/</span>mx<span style="color: #000000; font-weight: bold;">:</span>VBox<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>Script<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;!</span><span style="color: #000000;">&#91;</span>CDATA<span style="color: #000000;">&#91;</span>
			<span style="color: #0033ff; font-weight: bold;">import</span> flashx.textLayout.factory.TruncationOptions;
			<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span>.engine.Kerning;
			<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span>.engine.FontLookup;
			<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span>.engine.RenderingMode;
			<span style="color: #0033ff; font-weight: bold;">import</span> flashx.textLayout.formats.TextLayoutFormat;
			<span style="color: #0033ff; font-weight: bold;">import</span> flashx.textLayout.factory.StringTextLineFactory;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> sprite<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span>;
&nbsp;
			<span style="color: #000000;">&#91;</span>Bindable<span style="color: #000000;">&#93;</span> <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> isTruncated<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> fit<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
	        <span style="color: #000000;">&#123;</span>
	        	<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>sprite == <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span>
	        	<span style="color: #000000;">&#123;</span>
	        		sprite = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	        		ui.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>sprite<span style="color: #000000;">&#41;</span>;
	        	<span style="color: #000000;">&#125;</span>
	        	<span style="color: #0033ff; font-weight: bold;">while</span> <span style="color: #000000;">&#40;</span>sprite.<span style="color: #004993;">numChildren</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span>
	        	<span style="color: #000000;">&#123;</span>
	        		sprite.<span style="color: #004993;">removeChildAt</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span>;
	        	<span style="color: #000000;">&#125;</span>
	            <span style="color: #6699cc; font-weight: bold;">var</span> factory<span style="color: #000000; font-weight: bold;">:</span>StringTextLineFactory = <span style="color: #0033ff; font-weight: bold;">new</span> StringTextLineFactory<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
	            factory.compositionBounds = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Rectangle</span><span style="color: #000000;">&#40;</span> <span style="color: #000000; font-weight:bold;">10</span>, <span style="color: #000000; font-weight:bold;">10</span>, wSlider.<span style="color: #004993;">value</span>, hSlider.<span style="color: #004993;">value</span> <span style="color: #000000;">&#41;</span>;
&nbsp;
	            <span style="color: #6699cc; font-weight: bold;">var</span> format<span style="color: #000000; font-weight: bold;">:</span>TextLayoutFormat = <span style="color: #0033ff; font-weight: bold;">new</span> TextLayoutFormat<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	            format.fontFamily = <span style="color: #990000;">&quot;Verdana, _sans&quot;</span>;
	            format.<span style="color: #004993;">fontSize</span> = fsSlider.<span style="color: #004993;">value</span>;
	            format.<span style="color: #004993;">color</span> = 0x000000;
	            format.textAlpha = .9;
	            format.<span style="color: #004993;">kerning</span> = Kerning.ON;
	            format.renderingMode = RenderingMode.CFF;
				format.fontLookup = FontLookup.EMBEDDED_CFF;
	            factory.spanFormat = format;
&nbsp;
				<span style="color: #6699cc; font-weight: bold;">var</span> truncationOptions<span style="color: #000000; font-weight: bold;">:</span>TruncationOptions = <span style="color: #0033ff; font-weight: bold;">new</span> TruncationOptions<span style="color: #000000;">&#40;</span><span style="color: #990000;">'...'</span>,<span style="color: #000000; font-weight:bold;">3</span><span style="color: #000000;">&#41;</span>;
				factory.truncationOptions = truncationOptions;				
&nbsp;
&nbsp;
&nbsp;
	            factory.<span style="color: #004993;">text</span> = txtInput.<span style="color: #004993;">text</span>;
	            factory.createTextLines<span style="color: #000000;">&#40;</span> useTextLines <span style="color: #000000;">&#41;</span>;
&nbsp;
	            isTruncated = factory.isTruncated;
&nbsp;
	            sprite.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">clear</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	            sprite.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">beginFill</span><span style="color: #000000;">&#40;</span>0x555555,.5<span style="color: #000000;">&#41;</span>;
	            sprite.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">drawRect</span><span style="color: #000000;">&#40;</span> <span style="color: #000000; font-weight:bold;">10</span>,<span style="color: #000000; font-weight:bold;">10</span>, wSlider.<span style="color: #004993;">value</span>, hSlider.<span style="color: #004993;">value</span> <span style="color: #000000;">&#41;</span>;
	            sprite.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">endFill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	        <span style="color: #000000;">&#125;</span>
&nbsp;
	        <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> useTextLines<span style="color: #000000;">&#40;</span> line<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">DisplayObject</span> <span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
	        <span style="color: #000000;">&#123;</span>
	            <span style="color: #6699cc; font-weight: bold;">var</span> displayObject<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">DisplayObject</span> = sprite.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span> line <span style="color: #000000;">&#41;</span>;
	        <span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;/</span>mx<span style="color: #000000; font-weight: bold;">:</span>Script<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>mx<span style="color: #000000; font-weight: bold;">:</span>Application<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

 <div class='series_links'><a href='http://franto.com/text-layout-engine-in-flex-3/' title='Text Layout Engine in Flex 3'>Previous in series</a> <a href='http://franto.com/text-layout-engine-truncationoptions/' title='Text Layout Engine: TruncationOptions'>Next in series</a></div>]]></content:encoded>
			<wfw:commentRss>http://franto.com/text-layout-engine-fit-text-into-rectangle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
