Flex:MXML与“组件”之间的区别是什么?和一个MXML“模块”? [英] Flex: What's the difference between an MXML "Component" and an MXML "Module"?

查看:179
本文介绍了Flex:MXML与“组件”之间的区别是什么?和一个MXML“模块”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如标题所示,组件(新建 - > MXML组件)和模块(新建 - > MXML模块)之间的区别是什么?



感谢,
David

解决方案

模块被编译成SWF并在运行时使用ModuleLoader加载,而MXML组件被编译到一个应用程序。从Flex文档:

lockquote

模块是SWF文件,可以由应用程序加载和卸载

它们不能独立于
应用程序运行,但任何数量的
应用程序都可以共享这些模块。



模块让你分开你的应用程序
分成几个部分或模块。
主应用程序或shell可以
动态地加载
需要的其他模块,当它需要它们的时候。它
不必在
启动的时候加载所有的模块,如果用户不与
交互,也不需要加载任何
模块。当应用程序不再需要
时,它可以卸载
模块来释放内存和
资源。 [b]

模块类似于运行时共享
库(RSL),因为它们将
代码从应用程序分离到
分别加载的SWF文件。模块
比RSL
灵活得多,因为可以在运行时加载模块并
被卸载,并在没有应用程序的情况下编译



希望有帮助!


As the title suggests, what's the difference between a "Component" (New –> MXML Component) and a "Module" (New –> MXML Module)?

Thanks, David

解决方案

Modules are compiled into SWFs and loaded at runtime with ModuleLoader, whereas MXML components are compiled into an application. From the Flex docs:

Modules are SWF files that can be loaded and unloaded by an application. They cannot be run independently of an application, but any number of applications can share the modules.

Modules let you split your application into several pieces, or modules. The main application, or shell, can dynamically load other modules that it requires, when it needs them. It does not have to load all modules when it starts, nor does it have to load any modules if the user does not interact with them. When the application no longer needs a module, it can unload the module to free up memory and resources. [...]

Modules are similar to Runtime Shared Libraries (RSLs) in that they separate code from an application into separately loaded SWF files. Modules are much more flexible than RSLs because modules can be loaded and unloaded at run time and compiled without the application.

Hope that helps!

这篇关于Flex:MXML与“组件”之间的区别是什么?和一个MXML“模块”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆