Category Archives: ActionScript

ActionScript

Flex:使用direction控制TileList的显示方向

TileBase.direction
属性
direction:String  [读写]
此控件布置其子控件的方向。可能的值为 TileBaseDirection.HORIZONTAL 和 TileBaseDirection.VERTICAL。默认值为 TileBaseDirection

More…

Posted in ActionScript | Tagged , , , | 1 Comment

DragDrop时, 使用DragEvent.dragInitiator来获得Drag源头, 而非DragEvent.relatedObject

首发: http://riashanghai.com/node/123
问题描述:
在进行DragDrop时, 我使用了DragDrop.relatedObject来获得Drag触发的UIComponent
如: var dargUI:TileList = e.relatedObject as

More…

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

Flex: Datagrid派发ITEM_EDIT_BEGIN后因fm/focusManager为Null报错的解决方法

某DataGrid 监听Editor_BEGIN事件, 如果有数据未保存切换界面时, 会弹出Alert, 在弹出Alert之后, 确定切换界面时, DataGrid报错: DataGrid的itemEditorItemEditBeginHandler方法中: var fm:IFocusManager

More…

Posted in ActionScript | Tagged , , , , | 1 Comment

Flex: HttpService正常返回Html, 但派发FaultEvent事件的解决方法

HttpService的默认resultFormat为”object” HTTPService.RESULT_FORMAT_OBJECT 在服务器响应后, AbstractOperatoin.processResult()会对响应进行初步处理,

if (resultFor

More…

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

Flex:使用正则表达式替换String

需求: 通过某些字符串生成文件名称, 简单要求: 仅允许数字或字母及”_” 代码:

var regExp:RegExp = new RegExp(“[^A-Za-z0-9_]“, “g”); // 正则表达式, 将非字母数字或下划线的字符替换为”_”, 全部替换.
fi

More…

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