<?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>labs.hellokeita.com &#187; TextField</title>
	<atom:link href="http://labs.hellokeita.com/category/textfield/feed/" rel="self" type="application/rss+xml" />
	<link>http://labs.hellokeita.com</link>
	<description>Yet another labs blog</description>
	<lastBuildDate>Mon, 02 Aug 2010 11:20:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>TextField Selection Color</title>
		<link>http://labs.hellokeita.com/2008/03/13/textfield-selection-color/</link>
		<comments>http://labs.hellokeita.com/2008/03/13/textfield-selection-color/#comments</comments>
		<pubDate>Thu, 13 Mar 2008 12:35:00 +0000</pubDate>
		<dc:creator>keita</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[TextField]]></category>
		<category><![CDATA[source]]></category>

		<guid isPermaLink="false">http://labs.hellokeita.com/2008/03/13/textfield-selection-color/</guid>
		<description><![CDATA[Well, I just made a class to change the textField selection color.
It manipulates the ColorMatrixFilter to change the colors of the unselected text, selection background and selected text.

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_textSelectionColor_1891067107"
			class="flashmovie"
			width="468"
			height="170">
	<param name="movie" value="/files/textHighlight/textSelectionColor.swf" />
	<param name="bgcolor" value="#ffffff" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/files/textHighlight/textSelectionColor.swf"
			name="fm_textSelectionColor_1891067107"
			width="468"
			height="170">
		<param name="bgcolor" value="#ffffff" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
The source is in my SVN, http://code.hellokeita.in/public/trunk/as3/br/hellokeita/utils/TextFieldColor.as
And the usage is really simple too.
[code lang="actionscript"]
var textColor:uint = 0xff0000; // unselected text color
var [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I just made a class to change the textField selection color.<br />
It manipulates the ColorMatrixFilter to change the colors of the unselected text, selection background and selected text.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_textSelectionColor_343127487"
			class="flashmovie"
			width="468"
			height="170">
	<param name="movie" value="/files/textHighlight/textSelectionColor.swf" />
	<param name="bgcolor" value="#ffffff" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/files/textHighlight/textSelectionColor.swf"
			name="fm_textSelectionColor_343127487"
			width="468"
			height="170">
		<param name="bgcolor" value="#ffffff" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>The source is in my SVN, <a href="http://code.hellokeita.in/public/trunk/as3/br/hellokeita/utils/TextFieldColor.as" target="_blank">http://code.hellokeita.in/public/trunk/as3/br/hellokeita/utils/TextFieldColor.as</a></p>
<p>And the usage is really simple too.</p>
<p>[code lang="actionscript"]</p>
<p>var textColor:uint = 0xff0000; // unselected text color<br />
var selectionColor:uint = 0x00ff00; // selected background color<br />
var selectedColor:uint = 0x0000ff; // selected text color</p>
<p>var tf:TextField = new TextField();</p>
<p>addChild(tf);</p>
<p>var tfc:TextFieldColor = new TextFieldColor(tf, textColor, selectionColor, selectedColor);</p>
<p>//...<br />
// Or Also<br />
//...</p>
<p>tfc.textColor = textColor;<br />
tfc.selectionColor = selectionColor;<br />
tfc.selectedColor = selectedColor;</p>
<p>[/code]</p>
<a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2008/03/13/textfield-selection-color/&ztz=TextField Selection Color'><img src='http://labs.hellokeita.com/wp-content/plugins/hexosearch-button/logo16x16.png' width='16' height='16' border='0' style='padding:0px 5px 0px 0px;vertical-align:middle' alt='Vote in HexoSearch' title='Vote in HexoSearch' /></a> <span style='vertical-align:middle'><a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2008/03/13/textfield-selection-color/&ztz=TextField Selection Color'>Vote</a></span>]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2008/03/13/textfield-selection-color/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Text Highlighter &#8211; the trick</title>
		<link>http://labs.hellokeita.com/2007/11/19/text-highlighter-the-trick/</link>
		<comments>http://labs.hellokeita.com/2007/11/19/text-highlighter-the-trick/#comments</comments>
		<pubDate>Mon, 19 Nov 2007 05:21:39 +0000</pubDate>
		<dc:creator>keita</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[BitmapData]]></category>
		<category><![CDATA[TextField]]></category>
		<category><![CDATA[source]]></category>

		<guid isPermaLink="false">http://labs.hellokeita.com/2007/11/19/text-highlighter-the-trick/</guid>
		<description><![CDATA[Actually, I didn&#8217;t show the source because I wanted to know how many people was reading it, and was interested about it&#8230; so let me reveal the little trick.
First, I create a TextField, selectable(obviously) and set the alpha to zero.
Than, create a BitmapData with the TextField size, and, just draw the TextField on BitmapData each [...]]]></description>
			<content:encoded><![CDATA[<p>Actually, I didn&#8217;t show the source because I wanted to know how many people was reading it, and was interested about it&#8230; so let me reveal the little trick.</p>
<p>First, I create a TextField, selectable(obviously) and set the alpha to zero.<br />
Than, create a BitmapData with the TextField size, and, just draw the TextField on BitmapData each time the selection changes.<br />
When you draw the BitmapData, there is to ways to change the selection color, using the ColorTransform or PalleteMap methods.<br />
After that, you just place the Bitmap behind the textField.</p>
<p>[code lang="actionscript"]<br />
var color = 0xff0000;<br />
var c = ColorUtils.getRGB(color);</p>
<p>highlightBmpData.fillRect(highlightBmpData.rect, 0x00000000);<br />
highlightBmpData.draw(textField);<br />
highlightBmpData.colorTransform(highlightBmpData.rect, new ColorTransform(1, 1, 1, 1, c.r, c.g, c.b, 0));<br />
[/code]</p>
<p>One thing is that, using Color transform, you can change easily the smoothed fonts, and with PalleteMap is harder.<br />
Just remember that the selection color is always black, so you need to change the black part of the BitmapData to any color you want.</p>
<p>Easy huh?</p>
<p>PS: weird thing is that some people couldn&#8217;t see the effect on Mac with Firefox&#8230; I didn&#8217;t try it yet, but I&#8217;ll try to find a way to make it work.</p>
<a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2007/11/19/text-highlighter-the-trick/&ztz=Text Highlighter - the trick'><img src='http://labs.hellokeita.com/wp-content/plugins/hexosearch-button/logo16x16.png' width='16' height='16' border='0' style='padding:0px 5px 0px 0px;vertical-align:middle' alt='Vote in HexoSearch' title='Vote in HexoSearch' /></a> <span style='vertical-align:middle'><a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2007/11/19/text-highlighter-the-trick/&ztz=Text Highlighter - the trick'>Vote</a></span>]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2007/11/19/text-highlighter-the-trick/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Text Highlighter</title>
		<link>http://labs.hellokeita.com/2007/11/15/text-highlighter/</link>
		<comments>http://labs.hellokeita.com/2007/11/15/text-highlighter/#comments</comments>
		<pubDate>Thu, 15 Nov 2007 05:36:30 +0000</pubDate>
		<dc:creator>keita</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[TextField]]></category>

		<guid isPermaLink="false">http://labs.hellokeita.com/2007/11/15/text-highlighter/</guid>
		<description><![CDATA[Ever tried to change the textField selection color on Flash?
Here is it.
Click on the colored boxes and click and drag to select the text.

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_textHighlight_514247579"
			class="flashmovie"
			width="400"
			height="150">
	<param name="movie" value="/files/textHighlight/textHighlight.swf" />
	<param name="bgcolor" value="#000000" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/files/textHighlight/textHighlight.swf"
			name="fm_textHighlight_514247579"
			width="400"
			height="150">
		<param name="bgcolor" value="#000000" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
 Vote]]></description>
			<content:encoded><![CDATA[<p>Ever tried to change the textField selection color on Flash?</p>
<p>Here is it.</p>
<p>Click on the colored boxes and click and drag to select the text.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_textHighlight_1307164625"
			class="flashmovie"
			width="400"
			height="150">
	<param name="movie" value="/files/textHighlight/textHighlight.swf" />
	<param name="bgcolor" value="#000000" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/files/textHighlight/textHighlight.swf"
			name="fm_textHighlight_1307164625"
			width="400"
			height="150">
		<param name="bgcolor" value="#000000" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2007/11/15/text-highlighter/&ztz=Text Highlighter'><img src='http://labs.hellokeita.com/wp-content/plugins/hexosearch-button/logo16x16.png' width='16' height='16' border='0' style='padding:0px 5px 0px 0px;vertical-align:middle' alt='Vote in HexoSearch' title='Vote in HexoSearch' /></a> <span style='vertical-align:middle'><a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2007/11/15/text-highlighter/&ztz=Text Highlighter'>Vote</a></span>]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2007/11/15/text-highlighter/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
