|
沙发
楼主 |
发表于 2014-11-5 08:00:10
|
只看该作者
对上边文章的修正,不要使用openxlib来加载director xtra [aougu]
事情的经过是这样的,为了追求更高的效率,我按照上边这篇文章做了一个没有任何xtra的project,在运行以后再加载xtras,可是发现不行,一些xtras怎么样都加载不上,我就跑到micromedia的站点上查找,让我找到下边这个文章.
文章的意思是说作者不建议使用openxlib,原因有3
1,openxlib只能使用在script xtras上边,如果一个xtras包含tool 或者 asset Xtras 那么openxlib就不能加载这些xtras(我碰到的就是这样的情况)
2,openxlib的工作原理是让direcotor重新搜索所有的xtras,来判断那个是新加的xtras,这么做会降低程序的速度
3,对于一些使用了 BEGIN_XTRA_DEFINES_CLASS (我不懂,估计是编写xtras时候用的)的xtras会产生冲突,openxlib会加载错误的代码
原文如下,e文太差,不知道翻译的对不,反正我是不用了
Don』t use openXlib with Director Xtras
The openXlib command can load a scripting (Lingo) Xtra as well as the older Lingo XObject.
However, we recommend against using openXlib. Instead, place Xtras in the Xtras folder or a subfolder of it.
Here are some reasons against using openXlib.
openXlib only works for scripting Xtras. If an Xtra file contains tool or asset Xtras, openXlib won』t load them.
openXlib makes Director re-scan its set of Xtras to figure out what new Xtra is available. This can be slow.
Although openXlib makes Director re-scan Xtras, it still conflicts with the sophisticated versioning of Xtras (using BEGIN_XTRA_DEFINES_CLASS). openXlib may load the wrong code.
The only reason to use openXlib is if an Xtra has global or parent handlers and after a Lingo movie uses these you want to make the Xtra』s code unloadable. |
|