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;
......
import flash.events.Event;
import flash.net.URLLoader;
import flash.net.URLRequest;
private var loader:URLLoader = new URLLoader();
private var request:URLRequest = new URLRequest("a.txt");
private function initComplete():void
{
  ......
用了3天时间写了这个 第一版本 进度图, 其实也是甘特图的一种了,
目前甘特图有很多软件了,但是在线的还比较少,而且功能比较单一,
不过国内的倒是有几个, 一个是异度的,一个是向日葵的,都是用JS写的
还有个用FLASH 写的 也很不错, 我用FLEX 写了个,问题还是有的,比如占用CPU
资源过高,不过扩展性到是很强 。 ......
<?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">
......