Category Archives: ActionScript

ActionScript

Flex:使用正则表达式验证用户输入

目的: 使用正则表达式对数据进行校验
使用正则表达式的优点: 1. 可进行更为复杂的精确复杂的Validation; 2. 更重要的是, 在动态创建爱UI时, 可在xml, 数据库或其他持久性存储中存放对某一UI的正则表达式, 在创建后便可设定给有关ui.
如某UI只允许输入数字, 可监听FlexE

More…

Posted in ActionScript | Tagged , , , | Leave a comment

Flex 设置UI组件宽高的同时设置其百分比

设定一个组件的宽高, 且能随着外部容器变化而变化, 使用
explicitMinHeight: Number
布局过程中父级要考虑的组件最小建议高度。
Pasted from <http://livedocs.adobe.com/flex/3_cn/langref/mx/containers/

More…

Posted in ActionScript | Tagged , , | Leave a comment

Flex 将字符串编码为有效的 URI(统一资源标识符)

直接使用顶级方法:
encodeURI(uri:String):String
相关方法:
Boolean(expression:Object):Boolean
将 expression 参数转换为布尔值并返回该值。
Top Level
decodeURI(uri:String):String
将已编

More…

Posted in ActionScript | Tagged , , | Leave a comment

Flex: TextInput 监听回车事件

有时候需要监听TextInput的回车按下事件, 以直接进行某操作.

可使用FlexEvent.ENTER如:

_textKeywords.addEventListener(FlexEvent.ENTER, onTextKeyWordsEnterPressed);
Posted in ActionScript | Tagged , , | Leave a comment

List set row height 设置单元格的高度

rowHeight:Number [read-write]
The height of the rows in pixels. Unless the variableRowHeight property is true, all rows are the same height. If not s

More…

Posted in ActionScript, Flex | Tagged , , | Leave a comment