模块化和弹性视图状态
我见过一些类似的问题,但没有什么像我想要弄清楚的那样,所以这里是。我有一个具有许多视图状态的 Flex 应用程序,其中一些经常使用,一些则不经常使用。目前,所有这些状态都驻留在一个 mxml 文件中,因此只会生成一个 swf 文件并在客户端浏览器中加载。我想通过将这些视图状态分成不同的源文件并将状态从一个文件加载到另一个文件中来模块化这些视图状态,但是,我仍然希望用户只需加载一个 swf 文件。我这样做的主要原因是避免源文件超过 10,000 行。有解决这个问题的标准方法吗?
谢谢。
I've seen some similar questions, but nothing quite like what I'm trying to figure out, so here goes. I have a flex app with many view states, some of which are used frequently, some of which are not. Currently all these states reside in one mxml file so that only one swf file is generated and loaded in the client browser. I would like to modularize these view states by separating them out into different source files and just loading states from one file into another, however, I still want the user to only have to load one swf file. My main reason for this is to avoid having source files in excess of 10,000 lines. Is there a standard way of addressing this issue?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有两种方法可以满足您的要求。第一个是你所问的,第二个是我推荐的。
首先:
创建 main.mxml 应用程序,然后为每个状态创建单独的 component1.mxml 和 component2.mxml 文件。然后在您的应用程序中进行如下设置:
第二种方式,也是我推荐的一种方式,因为您对应用程序的描述将其分解为具有一个 swf 应用程序的多个 swf 模块。这样用户只下载他们计划使用的内容。在此场景中,执行与之前相同的操作,但创建模块而不是组件。
There are two ways of doing what you ask. The first is what it sounds like you are asking, the second is what I would recommend.
First:
Create your main.mxml application and then create separate component1.mxml and component2.mxml files for each of your states. Then in your application set it up like this:
The second way, and the one I recommend because of your description of the application breaks it down into multiple swf modules with one swf application. This way the user only downloads what they plan to use. In this scenario do the same as before but create modules instead of components.