Tag Archives: ActionScript

Flex中使用NavigateToURL实现HTML预览

尚未发现Flex中有可以直接渲染HTML代码的组件, 但可通过服务器端配合实现预览.

原理: Flex(尤指AIR环境), 使用URLLoader发送POST请求, 将要预览的HTML代码发送到服务器端Servlet, 服务器端收到请求后创建临时文件, 将HTML存到临时文件中. Flex端收到URLLoader Complete事件后, 使用navigateToURL navigate到Servlet上(使用GET), Servelet 返回文件内容 —- 在上述过程中, Flex端生成UUID作为代码读写的key.

More…

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

Flex中使用鼠标状态忙 Set Cursor Busy in Flex

一直没用过鼠标状态, 都是在忙的时候disable控制UI, 忙完了再enable.  某天看Flex Test Drive, 看上去很好啊:
但是虽然鼠标忙, 但仍旧可以使用, 因此说看上去很美 —- 所以你还是要对控制UI进行Enable/Disable
设置鼠标忙: CursorM

More…

Posted in ActionScript | Tagged , , | Leave a comment

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

需求: 设置DatagridColumn的Percent width

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

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

More…

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

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

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

More…

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

Flex 中使用ProgressBar / Using ProgressBar in Flex

在表示进度(如上传/下载)时, 可使用ProgressBar进行直观显示.
image

More…

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