flex IModuleInfo 注册事件失效问题
在flex 开发项目中,很多都会使用Module来减少application加载过大的问题。Module也确实解决了这个问题。
但是在使用Module过程中需要注意的一点 非常关键的一点那就是 定义一个IModuleInfo的时候 一定要记得把定义成全局变量哦。不然就会出现 第一次加载不了 二第二次 第三次。。。。都可以的效果。不注意这点找死了都找不出什么原因来。
为什么要定义成全局的。
原因看了下面的英文就知道了:
References to IModuleInfo must be maintained to keep the event listeneres alive. If the IModuleInfo is defined in function local scope the event listeners may get garbage collected.
google 的翻译是这样说的:
以IModuleInfo参考必须保持保持事件listeneres活着。如果IModuleInfo定义在函数的局部范围的事件监听器可能会被垃圾收集。
也就是说 在使用IModuleInfo 过程中始终要保持IModuleInfo 变量的存在,不然第一次就会被当做垃圾处理,才使得他注册事件第一次执行总是失效的问题。
相关文档:
document.body.oncopy = function() {
if (window.clipboardData) {
setTimeout(function() {
var text = clipboardData.getData("text");
......
源xml文件
<?xml version="1.0" encoding="iso-8859-1"?>
<books>
<stock>
<name>The Picasso Code</name>
<author>Dan Blue</author>
<category>Fiction</category>
<description>Cubist paintings reveal a secret society of people ......
<?xml version="1.0" encoding="utf-8"?>
<s:Application name="Spark_NumericStepper_textInput_editable_test"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xml ......
We're going to keep this post lean and mean, and get down to
business with 10 Tips that will keep your Flex applications fast, lean,
and responsive.
Rule # 1: Clean up after yourself
In general, it is good practice to maintain clean code. Not only
in the sense of having properly formatted and ......
前言
最近,正竭斯底里地重构flex技术平台开发的产品【wizBuilder CS】。以前为赶功能,界面部分代码都写得好乱,现在是时候修理下自己作的孽了,顺便为产品添加多语言支持(Localization)。
主要任务
代码重构
多语言支持
添加新功能、修改现有功能、去掉不合理的功能
修正重构过程中发现的 ......