模块中提供 Flex 4 XML 声明

发布于 2024-09-01 23:57:25 字数 227 浏览 6 评论 0原文

我正在构建一个使用 E4X/XML 加载数据的 Flex/Flash Builder 4 应用程序,如下所示:

我最初构建的应用程序是单个 MXML 文件,它加载此 XML 文件并根据数据构建表单。

我现在已经构建了一个主菜单屏幕,其中有一个按钮可以将表单屏幕作为单独的模块加载。如何让 XML 声明在该模块中工作而无需再次加载。难道只是在模块中重复声明那么简单吗?

I'm building a Flex/Flash Builder 4 application that loads data using E4X/XML, like this:

I originally build an application that was a single MXML file which loaded this XML file and built a form from the data.

I've now build a main menu screen with a button to load the form screen as a seperate module. How do I get the XML declaration to work in this module without loading it again. Is it as simple as repeating the declaration in the module?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

櫻之舞 2024-09-08 23:57:25

使用 Modular Flex 应用程序,您需要跨模块进行通信,而不需要在各部分之间建立紧密耦合。我通常使用消息总线方法(有关详细信息,请参阅Flex 截屏视频中的架构模式第一步)来完成此任务。当模块加载时,只需向总线发送一条消息,询问某人您需要的数据。在总线上有一个侦听器侦听该消息,以便它可以使用包含所需数据的另一条消息进行响应。

With Modular Flex apps you need to way to communicate across Modules without creating a tight coupling between the pieces. I usually use a Message Bus approach (see the Architectural Patterns First Steps in Flex screencast for more info) to accomplish this. When the module loads just send a message to the bus asking someone for the data you need. Have a listener on the bus listening for that message so that it can respond with another message containing the needed data.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文