<?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; Flex</title>
	<atom:link href="http://franto.com/category/development/flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://franto.com</link>
	<description></description>
	<lastBuildDate>Tue, 23 Aug 2011 10:29:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Flex Hero &#8211; Android links collection</title>
		<link>http://franto.com/flex-hero-android-links-collection/</link>
		<comments>http://franto.com/flex-hero-android-links-collection/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 23:21:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Flex Mobile Development]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Flex Hero]]></category>
		<category><![CDATA[flex mobile development]]></category>

		<guid isPermaLink="false">http://franto.com/?p=1175</guid>
		<description><![CDATA[Lately in my free time I&#8217;ve started to learn Flex Hero to be able to develop mobile applications for Android devices in Flex. I&#8217;ve downloaded Flash Builder Burrito from Adobe Labs, which already consists Flex Hero SDK, so I could immediately start developing my first Flex Android application. It&#8217;s quite new area and there is [...]]]></description>
			<content:encoded><![CDATA[<div class="TweetButton_button" style="float: right; margin-left: 10px;;height:20px;margin-bottom:5px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffranto.com%2Fflex-hero-android-links-collection%2F&amp;text=Flex Hero &#8211; Android links collection&amp;count=vertical&amp;lang=en&amp;related=android,Flex,Flex+Hero,flex+mobile+development"><img src="http://franto.com/blog2/wp-content/plugins/tweetbutton-for-wordpress/images/tweet.png" style="border:none" /></a></div>
<p>Lately in my free time I&#8217;ve started to learn <strong>Flex Hero</strong> to be able to develop mobile applications for Android devices in Flex. I&#8217;ve downloaded Flash Builder Burrito from Adobe Labs, which already consists Flex Hero SDK, so I could immediately start developing my <strong>first Flex Android application</strong>. It&#8217;s quite new area and there is lot of articles, tutorials, examples about <strong>Android application development in Flex Hero</strong>. I&#8217;m collecting links for me and for you as a source of help and knowledge base for developing Android applications in Flex. I hope my collection will be useful for you as good base to start playing with Flex Hero and Android devices. Enjoy it.</p>
<h3>Download IDE and SDKs</h3>
<ul>
<li><a href="http://labs.adobe.com/technologies/flashbuilder_burrito/">Flash Builder Burrito with Flex Hero SDK</a></li>
<li><a href="http://developer.android.com/sdk/index.html">Android SDK</a> (not needed)</li>
</ul>
<h3>Flex Hero Help</h3>
<ul>
<li><a href="http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/index.html?filter_air=2.5">Flex Hero SDK: AIR 2.5 Help</a></li>
<li><a href="http://labs.adobe.com/technologies/flex/mobile/">Mobile Application Development in Flex SDK Hero</a></li>
<li><a href="http://www.adobe.com/devnet/flex/articles/whatsnew_flashbuilder_burrito.html">What&#8217;s new in Flash Builder Burrito</a></li>
<li><a href="http://www.adobe.com/devnet/flex/articles/introducing_flexsdk_hero.html">Introducing Adobe Flex SDK Hero</a></li>
<li><a href="http://www.adobe.com/devnet/flex/articles/mobile_development_hero_burrito.html">Mobile development using Adobe Flex SDK Hero and Flash Builder Burrito</a></li>
<li><a href="http://help.adobe.com/en_US/as3/mobile/index.html">Adobe Flash Mobile Platform</a></li>
<li><a href="http://blogs.adobe.com/koestler/2010/11/code-package-and-debug-flex-mobile-apps-with-flash-builder-burrito.html">Code, Package and Debug Flex Mobile apps with Flash Builder Burrito</a></li>
<li><a href="http://thoughtfaqtory.com/blog/2010/11/10/adobe-flex-mobile-overview-part-1/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=adobe-flex-mobile-overview-part-1">Adobe Flex Mobile Overview &#8211; Part 1</a></li>
<p>	<!--li><a href="http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/flash/media/CameraRoll.html">CameraRoll</a></li-->
</ul>
<h3>Flex Hero &#8211; Android Development Tutorials</h3>
<ul>
<!--li><a href="http://www.adobe.com/devnet/air/flex/articles/using_mic_api.html">Using Microphone</a></li-->
<li><a href="http://soenkerohde.com/2010/11/how-to-skin-air-mobile-actionbar">How to Skin AIR Mobile ActionBar</a></li>
<li><a href="http://blogs.adobe.com/cantrell/archives/2010/11/uri-handlers-in-air-for-android-phone-calls-email-text-messages-maps-and-urls.html#">URI handlers in AIR for Android</a></li>
<li><a href="http://unitedmindset.com/jonbcampos/2010/11/01/flex-4-5-persistencemanager/?utm_source=feedburner&#038;utm_medium=feed&#038;utm_campaign=Feed:+TheWorldInAStateOfFlex+(The+World+In+A+State+of+Flex)&#038;utm_content=Twitter"<a href="http://unitedmindset.com/jonbcampos/2010/10/25/flex-4-5-mobile-development-post-burrito/">Flex 4.5 PersistenceManager</a></li>
<li><a href="http://insideria.com/2010/10/building-a-native-menu-in-flex.html?utm_source=feedburner&#038;utm_medium=feed&#038;utm_campaign=Feed:+oreilly/insideria+(InsideRIA)&#038;utm_content=Twitter">Building a native menu in Flex Mobile</a></li>
<li><a href="http://elromdesign.com/blog/2010/10/29/hacking-native-android-with-air-app-to-allow-air-access-unavailable-apis/">hacking native android with air app to allow air access unavailable apis</a></li>
<li><a href="http://unitedmindset.com/jonbcampos/2010/10/25/flex-4-5-mobile-development-post-burrito/">Flex 4.5 Mobile Development Post Burrito</a></li>
<li><a href="http://www.blogsdna.com/1939/how-to-install-non-market-apk-apps-on-google-android-g1-phone.htm">How to Install Non-Market .apk Apps on Google Android G1 Phone</a></li>
</ul>
<h3>Flex Android Development &#8211; Video tutorials</h3>
<ul>
<li><a href="http://tv.adobe.com/watch/adc-presents/flex-mobile-part-1-beginning-a-mobile-application">Flex Mobile Part 1: Beginning a mobile application</a></li>
<li><a href="http://tv.adobe.com/watch/adc-presents/flex-mobile-part-2-navigation-and-lists">Flex Mobile Part 2: Navigation and Lists</a></li>
<li><a href="http://tv.adobe.com/watch/adc-presents/flex-mobile-part-3-debug-and-package-apps-for-devices">Flex Mobile Part 3: Debug and package apps for devices</a></li>
<li><a href="http://tv.adobe.com/watch/adc-presents/debug-adobe-air-for-android-applications/">Debug Adobe AIR for Android applications</a></li>
<li><a href="http://www.youtube.com/watch?v=FrupuSKTRR4">First Adobe AIR for Android App</a></li>
</ul>
<h3>Custom Flex Android Mobile components</h3>
<ul>
<li><a href="http://franto.com/android-time-picker-for-flex-hero/">Android Time Picker for Flex Hero</a></li>
<li><a href="http://franto.com/android-date-picker-for-flex-hero/">Android Date Picker for Flex Hero</a></li>
</ul>
<h3>Optimizations techniques for Flex Mobile development</h3>
<ul>
<li><a href="http://insideria.com/2010/11/flash-player-101-mobile-optimi.html">Optimize Flash Content and Improving Usability on Mobile Devices &#8211; Part #1</a></li>
<li><a href="http://blog.benstucki.net/?p=65">Optimizing Flash Content for Mobile Devices</a> by Ben Stucki</li>
<li><a href="http://www.adobe.com/devnet/devices/fpmobile.html">Optimize web content for mobile delivery</a></li>
<li><a href="http://unitedmindset.com/jonbcampos/2010/09/08/optimization-techniques-for-air-for-android-apps/">Optimization Techniques for Air for Android apps</a></li>
<li><a href="http://unitedmindset.com/jonbcampos/2009/11/30/practical-performance-tweaks/">Practical Performance Tweaks</a> (not just mobile optimizations)</li>
<li><a href="http://blog.newmovieclip.com/2010/11/13/adobe-air-mobile-application-performance-optimization-on-android/">Adobe AIR Mobile: Application performance optimization on Android</a></li>
</ul>
<h3>Mobile Applications Performance</h3>
<ul>
<li><a href="http://github.com/mrdoob/stats.as/raw/master/src/net/hires/debug/Stats.as">Mr Doob’s Memory Monitor</a></li>
<li><a href="http://github.com/EladElrom/Flash-Optimizing-Tools">Flash Optimizing Tools</a> by Elad Elrom</li>
</ul>
<p>There are more than 30 links in <strong>Flex Hero &#8211; Android development links collection</strong>. If you are missing anything and want to add anything inside, please share your links in commenst and I will update collection. And please let me know if you are also trying, playing or learning <strong>Flex Hero for Flex Mobile apps development</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://franto.com/flex-hero-android-links-collection/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Android Time Picker for Flex Hero</title>
		<link>http://franto.com/android-time-picker-for-flex-hero/</link>
		<comments>http://franto.com/android-time-picker-for-flex-hero/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 19:47:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Flex Mobile Development]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[date picker]]></category>
		<category><![CDATA[flash builder burrito]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[flex mobile development]]></category>
		<category><![CDATA[time picker]]></category>

		<guid isPermaLink="false">http://franto.com/?p=1153</guid>
		<description><![CDATA[I&#8217;ve create new Android mobile component in Flex Hero. Last time I&#8217;ve created Android Date Picker, which allows you to pick date. But if you need change time, there is another component: Time Picker. So I&#8217;ve recreated it for Flex Hero. There are 2 different possibilities: changing time in AM/PM format or full day mode. [...]]]></description>
			<content:encoded><![CDATA[<div class="TweetButton_button" style="float: right; margin-left: 10px;;height:20px;margin-bottom:5px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffranto.com%2Fandroid-time-picker-for-flex-hero%2F&amp;text=Android Time Picker for Flex Hero&amp;count=vertical&amp;lang=en&amp;related=android,date+picker,flash+builder+burrito,Flex,flex+mobile+development,time+picker"><img src="http://franto.com/blog2/wp-content/plugins/tweetbutton-for-wordpress/images/tweet.png" style="border:none" /></a></div>
<p>I&#8217;ve create new Android mobile component in Flex Hero. Last time I&#8217;ve created <strong><a href="http://franto.com/android-date-picker-for-flex-hero/" alt="Android Date Picker for Flex Hero">Android Date Picker</a></strong>, which allows you to pick date. But if you need change time, there is another component: <strong>Time Picker</strong>. So I&#8217;ve recreated it for Flex Hero. There are 2 different possibilities: changing time in AM/PM format or full day mode. It&#8217;s just matter of setting property: timePicker.fullDayMode = true/false. In next article I will post new Time picker with gestures support and not using buttons +/- for changing hours, minutes and seconds. Using <strong>Android Time Picker for Flex Hero</strong> is similar as for Date Picker, just open it with PopupManager.addPopup. Please <a href="http://franto.com/uploads/examples/flex/android/DatePickerExample.fxp">download FXP project, which consist example of usage Time Picker</a> (Date Picker as well) and import it to your <strong>Flash Builder Burrito</strong>.</p>
<div style="text-align:center">
<img src="http://franto.com/uploads/android_time_picker.png" alt="native android time picker" title="native android time picker" width="200" height="284" class="size-full wp-image-1162" /><br />
Native Android Time Picker</p>
<p><img src="http://franto.com/uploads/AndroidTimePickerAMPM.png" alt="Android Time Picker AM/PM" title="Android Time Picker AM/PM" width="482" height="763" class="size-full wp-image-1154" /><br />
Android Time Picker for Flex Hero &#8211; AM/PM mode</p>
<p><img src="http://franto.com/uploads/AndroidTimePickerFullDayMode.png" alt="Android Time Picker - Full Day Mode" title="Android Time Picker - Full Day Mode" width="480" height="763" class="size-full wp-image-1163" /><br />
Android Time Picker for Flex Hero &#8211; full day mode
</div>
]]></content:encoded>
			<wfw:commentRss>http://franto.com/android-time-picker-for-flex-hero/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Android Date Picker for Flex Hero</title>
		<link>http://franto.com/android-date-picker-for-flex-hero/</link>
		<comments>http://franto.com/android-date-picker-for-flex-hero/#comments</comments>
		<pubDate>Sun, 07 Nov 2010 20:29:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Flex Mobile Development]]></category>
		<category><![CDATA[AIR 2.5]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[date picker]]></category>
		<category><![CDATA[flash builder burrito]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[flex mobile development]]></category>

		<guid isPermaLink="false">http://franto.com/?p=1144</guid>
		<description><![CDATA[I&#8217;ve been testing new Flex Hero SDK with AIR 2.5 on my HTC Desire HD. In Flash Builder Burrito it works very nice and smooth. Even debugging on mobile works nicely (computer and mobile must be connected to same wifi). I&#8217;m just playing and testing some new stuff and have needed date picker for choosing [...]]]></description>
			<content:encoded><![CDATA[<div class="TweetButton_button" style="float: right; margin-left: 10px;;height:20px;margin-bottom:5px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffranto.com%2Fandroid-date-picker-for-flex-hero%2F&amp;text=Android Date Picker for Flex Hero&amp;count=vertical&amp;lang=en&amp;related=AIR+2.5,android,date+picker,flash+builder+burrito,Flex,flex+mobile+development"><img src="http://franto.com/blog2/wp-content/plugins/tweetbutton-for-wordpress/images/tweet.png" style="border:none" /></a></div>
<p>I&#8217;ve been testing new <strong>Flex Hero SDK</strong> with <strong>AIR 2.5</strong> on my HTC Desire HD. In <strong>Flash Builder Burrito</strong> it works very nice and smooth. Even debugging on mobile works nicely (computer and mobile must be connected to same wifi). I&#8217;m just playing and testing some new stuff and have needed date picker for choosing date, but there is no such component in Flex Hero SDK I can use. So I&#8217;ve checked native Android Date Picker and try to create it from scratch in Flex. It&#8217;s pretty easy component, you can make it on your own in few minutes. But if you don&#8217;t want to bother to recreate it, you can just use mine.</p>
<div style="width:100%;text-align:center">
Native Android Date Picker:<br />
<img src="http://developer.android.com/resources/tutorials/views/images/hello-datepicker.png" alt="Native Android Date Picker" /><br />
Flex Android Date Picker:<br />
<a href="http://franto.com/uploads/FlexAndroidDatePicker.png" rel="lightbox"><img src="http://franto.com/uploads/FlexAndroidDatePicker.png" alt="Flex Android Date Picker" title="Flex Android Date Picker" width="480" height="763" class="size-full wp-image-1145" /></a></p>
<p><a href="http://franto.com/uploads/examples/flex/android/DatePickerExample.zip">Download sources as Flash Burrito project with .apk file.</a><br />
<i>This file is hosted straight from our <a href="http://www.webhostingsearch.com/" title="web hosting">web hosting</a> provider.</i>
</div>
<p>If you have already use another DatePicker or made your own one, let me know your thoughts. I&#8217;ve just tested it only on HTC Desire HD (screen resolution 480x800px).</p>
]]></content:encoded>
			<wfw:commentRss>http://franto.com/android-date-picker-for-flex-hero/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<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[<div class="TweetButton_button" style="float: right; margin-left: 10px;;height:20px;margin-bottom:5px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffranto.com%2Fproblems-with-latest-stable-flex-4-nightly-build%2F&amp;text=Problems with latest stable Flex 4 nightly build&amp;count=vertical&amp;lang=en&amp;related=Flex,Flex+4,nightly+build"><img src="http://franto.com/blog2/wp-content/plugins/tweetbutton-for-wordpress/images/tweet.png" style="border:none" /></a></div>
<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[<div class="TweetButton_button" style="float: right; margin-left: 10px;;height:20px;margin-bottom:5px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffranto.com%2Floosing-children-interactivity-after-setting-perspectiveprojection%2F&amp;text=Loosing children interactivity after setting perspectiveProjection&amp;count=vertical&amp;lang=en&amp;related=adobe+bug,field+of+view,Flash,flash+bug,Flex,perspective+projection"><img src="http://franto.com/blog2/wp-content/plugins/tweetbutton-for-wordpress/images/tweet.png" style="border:none" /></a></div>
<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>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> <div class="TweetButton_button" style="float: right; margin-left: 10px;;height:20px;margin-bottom:5px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffranto.com%2Fnumeric-sorting-of-flex-datagridcolumn%2F&amp;text=Numeric sorting of Flex DataGridColumn&amp;count=vertical&amp;lang=en"><img src="http://franto.com/blog2/wp-content/plugins/tweetbutton-for-wordpress/images/tweet.png" style="border:none" /></a></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>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> <div class="TweetButton_button" style="float: right; margin-left: 10px;;height:20px;margin-bottom:5px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffranto.com%2Ftext-layout-engine-truncationoptions%2F&amp;text=Text Layout Engine: TruncationOptions&amp;count=vertical&amp;lang=en&amp;related=Flex,Text+Layout+Engine"><img src="http://franto.com/blog2/wp-content/plugins/tweetbutton-for-wordpress/images/tweet.png" style="border:none" /></a></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 />
<!--start_raw--><br />
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"<br />
                        id="TextLayoutEngineExamples" width="100%" height="400"<br />
                        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"<br />
                                width="100%" height="400" name="TextLayoutEngineExamples" align="middle"<br />
                                play="true"<br />
                                loop="false"<br />
                                quality="high"<br />
                                allowScriptAccess="sameDomain"<br />
                                type="application/x-shockwave-flash"<br />
                                pluginspage="http://www.adobe.com/go/getflashplayer"></embed></object><br />
<!--end_raw--></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> <div class="TweetButton_button" style="float: right; margin-left: 10px;;height:20px;margin-bottom:5px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffranto.com%2Ftext-layout-engine-fit-text-into-rectangle%2F&amp;text=Text Layout Engine: Fit text into rectangle&amp;count=vertical&amp;lang=en&amp;related=Flex,Text+Layout+Engine"><img src="http://franto.com/blog2/wp-content/plugins/tweetbutton-for-wordpress/images/tweet.png" style="border:none" /></a></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 />
<!--start_raw--><br />
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"<br />
                        id="TextLayoutEngineExamples" width="100%" height="350"<br />
                        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"<br />
                                width="100%" height="350" name="TextLayoutEngineExamples" align="middle"<br />
                                play="true"<br />
                                loop="false"<br />
                                quality="high"<br />
                                allowScriptAccess="sameDomain"<br />
                                type="application/x-shockwave-flash"<br />
                                pluginspage="http://www.adobe.com/go/getflashplayer"></embed></object><br />
<!--end_raw--></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>
		<item>
		<title>Text Layout Engine in Flex 3</title>
		<link>http://franto.com/text-layout-engine-in-flex-3/</link>
		<comments>http://franto.com/text-layout-engine-in-flex-3/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 08:10:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Text Layout Engine]]></category>
		<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[Flex 4]]></category>

		<guid isPermaLink="false">http://franto.com/?p=1030</guid>
		<description><![CDATA[I&#8217;m going to play with Text Layout Engine, which is bundled in Flex 4. But we need to use it in Flex 3 in our Goalscape project. And it&#8217;s possible to use Text Layout Engine in Flex 3. All you need to do is download Flex 4 SDK, or Flash Builder and get textLayout.swc from [...]]]></description>
			<content:encoded><![CDATA[<div class='series_toc'><h3>Table of contents for Text Layout Engine</h3><ol><li>Text Layout Engine in Flex 3</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><a href='http://franto.com/text-layout-engine-truncationoptions/' title='Text Layout Engine: TruncationOptions'>Text Layout Engine: TruncationOptions</a></li></ol></div> <div class="TweetButton_button" style="float: right; margin-left: 10px;;height:20px;margin-bottom:5px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffranto.com%2Ftext-layout-engine-in-flex-3%2F&amp;text=Text Layout Engine in Flex 3&amp;count=vertical&amp;lang=en&amp;related=Flex,Flex+3,Flex+4,Text+Layout+Engine"><img src="http://franto.com/blog2/wp-content/plugins/tweetbutton-for-wordpress/images/tweet.png" style="border:none" /></a></div>
<p>I&#8217;m going to play with <strong>Text Layout Engine</strong>, which is bundled in <strong>Flex 4</strong>. But we need to use it in Flex 3 in our <strong><a href="http://www.goalscape.com">Goalscape</a></strong> project. And it&#8217;s possible to use <strong>Text Layout Engine</strong> in <strong>Flex 3</strong>. All you need to do is download <strong>Flex 4 SDK</strong>, or <strong>Flash Builder</strong> and get <strong>textLayout.swc</strong> from Flex 4 SDK into your project to libs folder. I&#8217;ve played with Flex 4 beta testLayout.swc, but now when Flex 4 beta 2 is released I&#8217;ve checked both .swc files and filesize has raised from 326kB to 531kB, so I&#8217;m really interested in what was changed or added. I will post about my tests when I will find out anything. So if you are interested in some <strong>Text Layout Engine examples</strong>, 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'>Next in series</a></div>]]></content:encoded>
			<wfw:commentRss>http://franto.com/text-layout-engine-in-flex-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unable to export SWC oem</title>
		<link>http://franto.com/unable-to-export-swc-oem/</link>
		<comments>http://franto.com/unable-to-export-swc-oem/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 08:00:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Flex Tips]]></category>
		<category><![CDATA[Error]]></category>

		<guid isPermaLink="false">http://franto.com/?p=1026</guid>
		<description><![CDATA[I have few times lately this error in Flex Builder and there were at least 2 cases, which cause this error to happen. So maybe it will help you to find your problem. Some file (in my case .flexLibProperties) has SVN conflicts, so you need to resolve conflicts and merge them to solve this &#8220;Unable [...]]]></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>Unable to export SWC oem</li><li><a href='http://franto.com/numeric-sorting-of-flex-datagridcolumn/' title='Numeric sorting of Flex DataGridColumn'>Numeric sorting of Flex DataGridColumn</a></li></ol></div> <div class="TweetButton_button" style="float: right; margin-left: 10px;;height:20px;margin-bottom:5px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffranto.com%2Funable-to-export-swc-oem%2F&amp;text=Unable to export SWC oem&amp;count=vertical&amp;lang=en&amp;related=Error,Flex,Flex+Tips"><img src="http://franto.com/blog2/wp-content/plugins/tweetbutton-for-wordpress/images/tweet.png" style="border:none" /></a></div>
<p>I have few times lately this error in Flex Builder and there were at least 2 cases, which cause this error to happen. So maybe it will help you to find your problem.</p>
<ul>
<li>Some file (in my case .flexLibProperties) has SVN conflicts, so you need to resolve conflicts and merge them to solve this &#8220;<strong>Unable to export SWC oem</strong>&#8221; error</li>
<li>In your library project there are some assets, which are not checked in project Properties/Flex Library Build Path/Assets Tab</li>
</ul>
<p>If you know about other case, which can cause &#8220;<strong>Unable to export SWC oem</strong>&#8221; error, please let me know in comments and I will add it here to help other people with their development. Thank you</p>
 <div class='series_links'><a href='http://franto.com/problem-with-xml-attributes-in-as3-0/' title='Problem with XML attributes in AS3.0'>Previous in series</a> <a href='http://franto.com/numeric-sorting-of-flex-datagridcolumn/' title='Numeric sorting of Flex DataGridColumn'>Next in series</a></div>]]></content:encoded>
			<wfw:commentRss>http://franto.com/unable-to-export-swc-oem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

