<?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; preventDefault</title>
	<atom:link href="http://blog.minidx.com/tag/preventdefault/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 Gumbo中如何通过selectionChanging事件和preventDefault()函数阻止用户选定DropDownList特定项目的例子</title>
		<link>http://blog.minidx.com/2009/08/11/2827.html</link>
		<comments>http://blog.minidx.com/2009/08/11/2827.html#comments</comments>
		<pubDate>Tue, 11 Aug 2009 00:11:01 +0000</pubDate>
		<dc:creator>Minidxer</dc:creator>
				<category><![CDATA[DropDownList]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[preventDefault]]></category>
		<category><![CDATA[selectionChanged]]></category>
		<category><![CDATA[selectionChanging]]></category>

		<guid isPermaLink="false">http://blog.minidx.com/?p=2827</guid>
		<description><![CDATA[接下来的Flex Gumbo中如何通过监听selectionChanging事件和调用preventDefault()函数，阻止用户选定DropDownList特定项目。 








下面是main.mxml：
&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62;
&#60;s:Application&#160;name=&#34;DropDownList_selectionChanging_test&#34;
&#160; &#160; &#160; &#160; xmlns:fx=&#34;http://ns.adobe.com/mxml/2009&#34;
&#160; &#160; &#160; &#160; xmlns:s=&#34;library://ns.adobe.com/flex/spark&#34;
&#160; &#160; &#160; &#160; xmlns=&#34;library://ns.adobe.com/flex/halo&#34;&#62;
&#160;
&#160; &#160; &#60;fx:Script&#62;
&#160; &#160; &#160; &#160; &#60;![CDATA[
&#160; &#160; &#160; &#160; &#160; &#160; import mx.controls.Alert;
&#160; &#160; &#160; &#160; &#160; &#160; import mx.events.IndexChangedEvent;
&#160;
&#160; &#160; &#160; &#160; &#160; &#160; private function dropDownList_selectionChanging(evt:IndexChangedEvent):void {
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; var ddl:DropDownList [...]]]></description>
		<wfw:commentRss>http://blog.minidx.com/2009/08/11/2827.html/feed</wfw:commentRss>
		<slash:comments>0</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.165 seconds using disk
Object Caching 218/445 objects using disk

Served from: blog.minidx.com @ 2012-02-09 22:07:52 -->
