flex中使用正则表达式
<mx:TextInput id="userName" maxChars="4" restrict="a-zA-Z0-9" />
restrict 用法:
TextField.restrict = "此处为可输入的内容";
field.restrict = "^此处为禁止输入的内容";
restrict属性支持一些类似正则表达式的样式:
field.restrict = "a-zA-z"; //只允许大小字母
field.restrict = "a-zA-z "; //只允许字母和空格
field.restrict = "0-9"; //只允许数字
field.restrict = "^abcdefg"; //除了小写字母abcdefg不允许外,其它都允许
field.restrict = "^a-z"; //所有小写字母都不允许,但是,其它内容都允许,包括大写字母
field.restrict = "0-9^5"; //只允许数字,但5例外
让restrict字符包含具有特殊意义的字母(例如-和^):
field.restrict = "0-9\\-"; //允许数字和破折号
field.restrict = "0-9\\^"; //允许数字和^
field.restrict = "0-9\\\\"; //允许数字和反斜杠
你也可以使用Unicode转义序列,指定允许的内容.例如:
field.restrict = "^\u001A";
注意:ActionScript有区分大小写的,如果restrict属性设为abc,允许字母的大写形式(A,B和C)输入时会变成小写对待形式(a,b和c),反之亦然.restrict属性只影响用户可以输入的内容,脚本可将任何文本放入文本字段中.
相关文档:
拖动水平滚动条来改变图片大小。
<?xml version="1.0"?>
<!--
Simple example to demonstrate the HSlider control.
水平拖动条。
MyShareBook.cn 翻译   ......
<?xml version="1.0"?>
<!-- Simple example to demonstrate the ProgressBar control. -->
<!--
如何使用Flex ProgressBar
MyShareBook.cn 翻译
-->
<mx:Applic ......
传统的在Flex工程中添加Module的方法是:在FlashBuilder中右键工程目录->Porperties->Flex Modules, 然后就可以add/edit/remove需要的module了,
但问题 是无论添加多少module都要点击add按钮一个一个添加! 像我们的项目一个demo就用了好几十个module,一个一个添加可要烦死了
网上搜‘批量添加module&rsquo ......
http://www.k-zone.cn/zblog/post/flex-compiler-parameter.html
下面的列表提供了mxmlc的一些可选参数:
属性
描述
accessible=true|false
是否具有可理解性
actionscript-file-encoding
设置文件编码
advanced | mxmlc -help advanced
检索mxmlc高级参数
allow-source-path-overlap=true|false
验证source-pat ......
原来是这样,
我一开始用的是flex_sdk_3.4.1.10084(Stable Builds),(由于sdk3.5有combobox的bug),但是在用RSL的时候,发现flash player 的AssetCache里就是没有swz,
原因是:我用的sdk是Stable Builds,它是没有swz的,
官网的解释是:
The Flex team dos not currently create signed versions of the major RSL ......