如何让Flex项目在运行时加载插件?

时间:2023-01-24 17:59:12

I'm looking to have a couple of plugins in a Flex project I'm working on. I know I can load a SWF using the SWFLoader, but I thought in Flex3 you can now have Runtime Shared Libraries or something. Does anyone have any good documentation on loading a plugin at runtime? Ideally I'd like to be able to load a plugin from a URL, then execute some code from within the plugin (e.g. add a control to the page).

我正在寻找一个我正在研究的Flex项目中的几个插件。我知道我可以使用SWFLoader加载SWF,但我认为在Flex3中你现在可以拥有运行时共享库​​。有没有人有关于在运行时加载插件的任何好文档?理想情况下,我希望能够从URL加载插件,然后从插件中执行一些代码(例如,向页面添加控件)。

3 个解决方案

#1


3  

You can use either Modules or RSL.

您可以使用模块或RSL。

RSLs have the advantage of getting cached by flash rather than the browser so they stick around longer.

RSL的优点是可以通过闪存而不是浏览器进行缓存,因此它们可以更长时间地保留。

Modules are easier to create and use. I have used modules and had issues with modules failing to load (code needs to handle that case). I haven't tried RSLs yet.

模块更易于创建和使用。我使用过模块,并且模块无法加载(代码需要处理这种情况)。我还没有尝试过RSL。

Here is some documentation on creating RSLs http://labs.adobe.com/wiki/index.php/Flex_3:Feature_Introductions:Flex_3_RSLs

以下是有关创建RSL的一些文档http://labs.adobe.com/wiki/index.php/Flex_3:Feature_Introductions:Flex_3_RSLs

#2


0  

Note that, currently, loaded RSLs must be compiled against the very same version of the Flex framework.. if you plan for a "binary" plugin system, probably you want to wait for the Marshall plan feature to be implemented, in the next Flex version.

请注意,目前,加载的RSL必须针对相同版本的Flex框架进行编译。如果您计划使用“二进制”插件系统,可能需要等待Marshall计划功能在下一个Flex中实现。版。

#3


0  

If you want to try a new and alternative approach, this is a application core framework modelled after java OSGi: http://www.potomacframework.org/ I haven't tried it myself, but it looks really cool!

如果你想尝试一种新的替代方法,这是一个以java OSGi为模型的应用程序核心框架:http://www.potomacframework.org/我自己没有尝试过,但看起来真的很酷!

#1


3  

You can use either Modules or RSL.

您可以使用模块或RSL。

RSLs have the advantage of getting cached by flash rather than the browser so they stick around longer.

RSL的优点是可以通过闪存而不是浏览器进行缓存,因此它们可以更长时间地保留。

Modules are easier to create and use. I have used modules and had issues with modules failing to load (code needs to handle that case). I haven't tried RSLs yet.

模块更易于创建和使用。我使用过模块,并且模块无法加载(代码需要处理这种情况)。我还没有尝试过RSL。

Here is some documentation on creating RSLs http://labs.adobe.com/wiki/index.php/Flex_3:Feature_Introductions:Flex_3_RSLs

以下是有关创建RSL的一些文档http://labs.adobe.com/wiki/index.php/Flex_3:Feature_Introductions:Flex_3_RSLs

#2


0  

Note that, currently, loaded RSLs must be compiled against the very same version of the Flex framework.. if you plan for a "binary" plugin system, probably you want to wait for the Marshall plan feature to be implemented, in the next Flex version.

请注意,目前,加载的RSL必须针对相同版本的Flex框架进行编译。如果您计划使用“二进制”插件系统,可能需要等待Marshall计划功能在下一个Flex中实现。版。

#3


0  

If you want to try a new and alternative approach, this is a application core framework modelled after java OSGi: http://www.potomacframework.org/ I haven't tried it myself, but it looks really cool!

如果你想尝试一种新的替代方法,这是一个以java OSGi为模型的应用程序核心框架:http://www.potomacframework.org/我自己没有尝试过,但看起来真的很酷!