flex内存泄露解决之道
(1)Event Listeners
Listening to parent objects does cause memory leaks
e.g.
override protected function mouseDownHandler(…):void {
systemManager.addEventListener(“mouseUp”, mouseUpHandler);
you can:
1.Removing the addEventListener (when dispose).
systemManager.removeEventListener(“mouseUp”, mouseUpHandler);
2. Use of weak reference listeners
override protected function mouseDownHandler(…):void {
systemManager.addEventListener(“mouseUp”, mouseUpHandler, false, 0, true);
These do not block garbage collection(generally do not cause memory leaks):
Weak References
Self References
References to Child Objects
weak reference event listener e.g.
&nb
相关文档:
<?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the DateTimeAxis class. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
import mx.collections.ArrayCollection;
......
(1)tree点击事件public function handleList(ev:ResultEvent)
{
sourceList=ev.result as ArrayCollection;
}
private function tree_itemClick(evt:ListEvent):void {
var item:Object = Tree(evt.currentTarget).selectedItem;
if (pmtree.dataDescriptor.isBranch(item)) {
......
[原创]Flex中DataGrid分页(客户端、服务端)
这两天做了一个Flex的DataGrid分页(paging)控件,支持客户端、服务端两种分页形式;这里着重分享一下思路,虽然是用flex做的,但只要掌握了思路,用别的编程语言也能达到同样的效果。
组件运行截图:
设计思路:
1,客户端、服务端
(1)客户端分页:将 ......
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal">
<mx:Panel width="382" height="277" layout="absolute">
......