Category Archives: ActionScript

ActionScript

[旧文存档]Flex: Alert 使用总结 Using Alert in Flex

1. 通过Alert强制用户选择.

2. 使用一个方法 Handle多个Alert.

// 弹出Alert
Alert.show(RM.getString(BUNDLE_ONLINE_TEST, "olt.attempt.warn.remove"), RM.getStr

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

Flex: Setting Datagrid column percentWidth – 设置Datagrid 列宽度为百分比

需求: 设置DatagridColumn的Percent width

临时解决方法: 监听Datagrid的CREATION_COMPLETE事件, 在响应函数中重置Column的宽度.

效果: 参见http://cutown.com/home/reg.php, 网页内嵌入的Datagrid中, 后两列宽度为首列之外的宽度均分.

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

Using crossdomain.xml (Error #2048 Error #2170…) 使用crossdomain控制跨域访问

当试图与某站外URL的进行数据交互时 (如通过URLLoader), 如果目标站点无crossdomain.xml或该文件未允许当前站点的访问, 则会出现#2048, #2170等错误.

image
Cross-domain policy file specification (PDF, 129 KB)

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

ActionScript中呼叫JavaScript方法 – Call JavaScript Function In ActionScript

需求: 在某些情况时, 如某Event响应后, 需要呼叫外部的JS代码以进行有关操作.
image

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

Flex:自定义ItemRender重写set data时低级错误一例(附Box作ItemRender代码)

使用ActionScript做Render时一般都会重写set data以实现具体效果, 洒家每次犯过多次低级错误, 那便是忘记set data时super之.

忘记super的后果是数据可能不会正常显示, Datagrid可能在浮动/点击 Render时 所在行没反应.

Posted in ActionScript, Flex | Tagged | Leave a comment