<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Restricting the number of characters a user can type into a TextInput component in Flash using ActionScript 3.0</title>
	<atom:link href="http://actionscriptexamples.com/2008/12/22/restricting-the-number-of-characters-a-user-can-type-into-a-textinput-component-in-flash-using-actionscript-30/feed/" rel="self" type="application/rss+xml" />
	<link>http://actionscriptexamples.com/2008/12/22/restricting-the-number-of-characters-a-user-can-type-into-a-textinput-component-in-flash-using-actionscript-30/</link>
	<description>A bunch of ActionScript 2.0 and ActionScript 3.0 examples*</description>
	<lastBuildDate>Sun, 21 Mar 2010 00:56:04 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Peter deHaan</title>
		<link>http://actionscriptexamples.com/2008/12/22/restricting-the-number-of-characters-a-user-can-type-into-a-textinput-component-in-flash-using-actionscript-30/comment-page-1/#comment-228</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Mon, 22 Dec 2008 21:48:25 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/?p=295#comment-228</guid>
		<description>Daniel Rodriguez,

As far as I know there isn&#039;t a way to make text selectable, but not cause scrolling in a text field. The &lt;code&gt;maxChars&lt;/code&gt; property only applies when a user is typing content in, it doesn&#039;t apply when you set the text using ActionScript.
You could try trimming the content to a certain number of characters by using the &lt;code&gt;substr()&lt;/code&gt; or &lt;code&gt;substring()&lt;/code&gt; methods:

&lt;pre lang=&quot;actionscript3&quot;&gt;
ti.text = &quot;The quick brown fox jumps over the lazy dog.&quot;;
trace(&quot;substring():&quot;, ti.text.substring(0, ti.maxChars));
trace(&quot;substr():&quot;, ti.text.substr(0, ti.maxChars));
&lt;/pre&gt;

Peter</description>
		<content:encoded><![CDATA[<p>Daniel Rodriguez,</p>
<p>As far as I know there isn&#8217;t a way to make text selectable, but not cause scrolling in a text field. The <code>maxChars</code> property only applies when a user is typing content in, it doesn&#8217;t apply when you set the text using ActionScript.<br />
You could try trimming the content to a certain number of characters by using the <code>substr()</code> or <code>substring()</code> methods:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">ti.<span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;The quick brown fox jumps over the lazy dog.&quot;</span>;
<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;substring():&quot;</span>, ti.<span style="color: #004993;">text</span>.<span style="color: #004993;">substring</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>, ti.<span style="color: #004993;">maxChars</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;substr():&quot;</span>, ti.<span style="color: #004993;">text</span>.<span style="color: #004993;">substr</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>, ti.<span style="color: #004993;">maxChars</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;</pre></div></div>

<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Rodriguez</title>
		<link>http://actionscriptexamples.com/2008/12/22/restricting-the-number-of-characters-a-user-can-type-into-a-textinput-component-in-flash-using-actionscript-30/comment-page-1/#comment-227</link>
		<dc:creator>Daniel Rodriguez</dc:creator>
		<pubDate>Mon, 22 Dec 2008 20:03:59 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/?p=295#comment-227</guid>
		<description>Hi Peter,
There is a way to restrict the max number of characters in a dynamic text field?
I&#039;m loading a text from a data base, but in some cases the text is larger than the Dynamic Text Field and this made the text field scrollable and I don&#039;t want that, I could make the Text Field not selectable, but I want it to be selectable.
May be is property I&#039;m missing... an scrollable property or something
Thanks!</description>
		<content:encoded><![CDATA[<p>Hi Peter,<br />
There is a way to restrict the max number of characters in a dynamic text field?<br />
I&#8217;m loading a text from a data base, but in some cases the text is larger than the Dynamic Text Field and this made the text field scrollable and I don&#8217;t want that, I could make the Text Field not selectable, but I want it to be selectable.<br />
May be is property I&#8217;m missing&#8230; an scrollable property or something<br />
Thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
