<?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>中文Flex例子 &#187; TextEvent</title>
	<atom:link href="http://blog.minidx.com/tag/textevent/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.minidx.com</link>
	<description>中文Adobe Flex例子,Flex实例教程,RIA资源,全文检索技术,算法和数据结构</description>
	<lastBuildDate>Thu, 31 Mar 2011 03:22:33 +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>Flex中如何在Panel控件的status文本中添加一个链接的例子</title>
		<link>http://blog.minidx.com/2008/04/18/738.html</link>
		<comments>http://blog.minidx.com/2008/04/18/738.html#comments</comments>
		<pubDate>Fri, 18 Apr 2008 13:06:07 +0000</pubDate>
		<dc:creator>Minidxer</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[getStatusTextField]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[mx_internal]]></category>
		<category><![CDATA[Panel]]></category>
		<category><![CDATA[selectable]]></category>
		<category><![CDATA[TextEvent]]></category>
		<category><![CDATA[链接]]></category>

		<guid isPermaLink="false">http://blog.minidx.com/2008/04/18/738.html</guid>
		<description><![CDATA[接下来的例子演示了如何利用getStatusTextField()事件和mx_internal命名空间，在Flex的Panel容器的status文本中指定一个HTML格式的链接字符串。
需要注意的是：和前面的如何显示，隐藏Flex的TitleWindow容器关闭按钮(close button)的例子，Flex的Alert消息框中设置icon图标的例子等一样，由于例子中用到了mx_internal命名空间（namespace），无法保证在后续版本的Flex SDK中都可以正常工作，使用的时候自己要斟酌一下。








让我们先来看一下Demo（可以右键View Source或点击这里察看源代码）

下面是完整代码(或点击这里察看)：
Download: main.mxml&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62;
&#60;mx:Application&#160;xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34;
&#160; &#160; &#160; &#160; layout=&#34;vertical&#34;
&#160; &#160; &#160; &#160; verticalAlign=&#34;middle&#34;
&#160; &#160; &#160; &#160; backgroundColor=&#34;white&#34;
&#160; &#160; &#160; &#160; creationComplete=&#34;init();&#34;&#62;
&#160;
&#160; &#160; &#60;mx:Script&#62;
&#160; &#160; &#160; &#160; &#60;![CDATA[
&#160; &#160; &#160; &#160; &#160; &#160; import&#160;mx.core.IUITextField;
&#160; &#160; &#160; &#160; &#160; &#160; import&#160;mx.controls.Alert;
&#160;
&#160; &#160; &#160; &#160; &#160; &#160; private&#160;function init():void {
&#160; &#160; &#160; &#160; &#160; &#160; &#160; [...]]]></description>
		<wfw:commentRss>http://blog.minidx.com/2008/04/18/738.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>如何通过监听textInput事件截获Flex的TextArea控件的回车</title>
		<link>http://blog.minidx.com/2008/03/09/556.html</link>
		<comments>http://blog.minidx.com/2008/03/09/556.html#comments</comments>
		<pubDate>Sun, 09 Mar 2008 04:28:38 +0000</pubDate>
		<dc:creator>Minidxer</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[preventDefault]]></category>
		<category><![CDATA[TextArea]]></category>
		<category><![CDATA[TextEvent]]></category>
		<category><![CDATA[TextInput]]></category>

		<guid isPermaLink="false">http://blog.minidx.com/2008/03/09/556.html</guid>
		<description><![CDATA[下面的例子展示了如何通过监听TextArea的textInput事件和检查TextEvent对象的text属性，来截获该控件中按下的回车换行。
下面是具体的源代码：








Download: main.mxml&#60;!-- http://blog.flexexamples.com/2008/03/07/preventing-line-feeds-in-a-textarea-control-in-flex/ --&#62;
&#60;mx:application&#160;xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34;&#62;
layout=&#34;vertical&#34;
verticalAlign=&#34;middle&#34;
backgroundColor=&#34;white&#34;&#38;gt;&#60;/mx:application&#62;
&#160;
&#60;mx:script&#62;
&#60;!--[CDATA[
private function textArea_textInput(evt:TextEvent):void {
if (evt.text == &#34;\n&#34;) {
evt.preventDefault();
}
}
]]--&#62;
&#60;/mx:script&#62;
&#160;
&#60;mx:textarea&#160;id=&#34;textArea&#34;&#62;
verticalScrollPolicy=&#34;on&#34;
width=&#34;160&#34;
height=&#34;120&#34;
textInput=&#34;textArea_textInput(event);&#34;&#38;gt;
&#60;mx:text&#62;The&#160;quick brown fox jumped over the lazy dog.&#60;/mx:text&#62;
&#60;/mx:textarea&#62;
下面是执行实例：

原文作者：Peter deHaan 翻译：minidxer
你可能还对下列文章感兴趣:Flex中如何通过设置editable属性控制NumericStepper控件可编辑/不可编辑状态的例子Flex中如何通过设置restrict属性在TextInput控件中限制用户可以输入的字符串的例子Flex中如何利用getTextField事件和numLines属性，计算出TextArea控件中内容的行数的例子Flex中如何设置TextArea控件中的无效(disabled)文本颜色的例子Flex的TextArea控件中如何利用setSelection事件设定文本选中范围的例子]]></description>
		<wfw:commentRss>http://blog.minidx.com/2008/03/09/556.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching 2/19 queries in 0.226 seconds using disk
Object Caching 228/462 objects using disk

Served from: blog.minidx.com @ 2012-02-09 19:37:47 -->
