伪美&生活
-
2009-02-21
flex magic bug3:几个垃圾回收的问题或bug - [flex|flash]
恶战了几天flex的垃圾回收,小有结果,包括:
1 在module中用<mx:Style>方式引入css文件(编译期),则,扯淡。经测试目前找到两种解决方法,一种是把<mx:Style>放到main app domain中去,因为module默认会继承main domain的css;第二种是把css编成swf后,在module中动态加载。估计module在编译期引入css时,会引用到main domain中的东西,造成无法GC。
2 mate框架中的Injector方法,类似映射或绑定,非常好用,但是很不幸,测试了n次后发现Injector会带来无法GC的问题,最近是没空再去翻mate源码了,用as自己的bindingUtil代替后问题解决。但mate maker说Injector不会产生GC问题。。。magic。
3 冷到家的一个bug。。。memory leak when using TextInput and TextArea when click the keyboard 只要用TextInput之类的组件,就无法垃圾回收,连这个都让我测试出来了- -b真不容易,可惜的是在上述链接中发现flash player team正在解决ing。。。于是到这一步垃圾回收战可以打住了,因为实在无法避免不用TextInput - -b,总得注册登录吧。。。爱谁谁,估计最后内存占用会超过100M……
以下是几个介绍垃圾回收的链接(决定以后按时阅读flex bug list。。。以上几个bug自己测出来太bt了):
http://roshantitus.blogspot.com/2008/11/flex-memory-management.html
http://www.cnblogs.com/janyou/archive/2008/11/25/1340753.html
http://www.nutrixinteractive.com/blog/?p=132
http://www.gskinner.com/blog/archives/2006/06/as3_resource_ma.html
http://blogs.adobe.com/aharui/2007/03/garbage_collection_and_memory.html
-
2008-12-11
正常使用 flex profiler - [flex|flash]
使用profiler时一直报socket timeout
查了资料后,需要在mm.cfg中加一行 PreloadSwf=<work space>\.metadata\.plugins\com.adobe.flash.profiler/ProfilerAgent.swf?debug=true
mm.cfg的位置:flex help的《Configuring the debugger version of Flash Player》
之前测了很久都不通,主要跟我把系统环境变量里的homepath放到了e盘,以及flex builder默认的workspace也改动过多次,所以整个乱掉了。。。
其他比较容易解决的出错原因:flash player要用debug版本;要让profiler的连接通过防火墙;等等。
-
2008-12-06
flex notes 之:对getter函数的数据绑定 - [flex|flash]
天天忙于实际项目的结果之一,就是来来回回反反复复测代码,就是不愿意停下来查原理。
这会儿实在不想test了,查了查把数据绑定到getter function上为何不更新。flex帮助文档结果如下:
Using read-only properties as the source for data binding
You can use a read-only property defined by a getter method, which means no setter method, as the source for a data-binding expression. Flex performs the data binding once when the application starts.
原来只在程序初始化时执行一次绑定,所以在必要时还得用事件推一推。
-
2008-11-30
flex magic bug2:Adobe Air application has a limit on maximum window size ( about 2900 pixels ) - [flex|flash]
在上海癫子异术节期间本打算用AIR解决方案,后来在要扩大窗口到四显示屏时,就是无法把窗口拖动到接近四屏宽处,后查到air的一个bug:窗口最大size不能超过2900左右,非常冷。
Adobe记录:
-
今天试用cast3d时,sample的例子就是调试不通,提示“An internal build error has occurred”。用排除法一直把范围缩小到TrackBall.as这个文件,之后就进行不下去了。
google+百度后,最后出来一个结果:(顺便在此时百度遭受围攻时挺一把百度,双搜索引擎并用才是王道)
http://www.niuniuzhu.cn/blog//html/2008/09/200809120139006816.htm
里面提到flex在使用空switch时会出bug,TrackBall.as里出错的就是这一句:switch( event.keyCode ){}
Adobe官方也记录了该bug: http://bugs.adobe.com/jira/browse/SDK-15701










