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
相关文档:
FLEX编译的SWF文件,只能选择访问本地文件或访问网络文件,二者只能取一(嗯,为什么?我也不知道,官方说是为了安全考虑),而FLEX编译的默认选项是只能访问网络文件,所以你将bin里的东西COPY到其他地方就不能读取了。而你在默认的bin目录下可以读取得到,是因为FLEX认为你是在IDE环境种,这时是没有这个所谓的安全限制的 ......
1、自定义组件
2、自定义事件
3、结合使用
一、自定义组件(使用的是Flex组件,ActionScript组件相对麻烦点,可视化差点)
该组件由一个TextArea和两个Button组成,如图:
代码:
MyComponent.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width=" ......
ArrayCollection转成xml类型示例
下面模拟一组数据exams,将其转化为xml形式.详细代码见下:
Xml代码
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" fontSize="12" creationComplet ......
Blinds.as
package effects
{
import effects.effectClasses.BlindsInstance;
import mx.controls.scrollClasses.ScrollBarDirection;
import mx.effects.IEffectInstance;
import mx.effects.TweenEffect;
public class Blinds extends TweenEffect
{
......
用了3天时间写了这个 第一版本 进度图, 其实也是甘特图的一种了,
目前甘特图有很多软件了,但是在线的还比较少,而且功能比较单一,
不过国内的倒是有几个, 一个是异度的,一个是向日葵的,都是用JS写的
还有个用FLASH 写的 也很不错, 我用FLEX 写了个,问题还是有的,比如占用CPU
资源过高,不过扩展性到是很强 。 ......