在运行时将 xml 配置文件动态加载到 Flex4/Flash 影片中的最佳方法?

发布于 2024-08-19 12:10:12 字数 222 浏览 7 评论 0原文

我有一个关于在运行时在 SWF 中加载 xml 文件的相当简单的问题。

我发现了几种不同的方法来加载 xml。

  • myXml.load("文件.xml");
  • HTTPService 对象
  • URLStream 对象

加载始终具有相同名称且与 Web 服务器上的 SWF 位于同一文件夹中的 xml 文件的更好方法是什么?

I've got a rather simple question about loading in an xml file at runtime in a SWF.

I've found a couple different methods to load in the xml.

  • myXml.load("file.xml");
  • HTTPService object
  • URLStream object

What is better way to load an xml file that always has the same name and is located in the same folder as the SWF on the web server?

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

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

发布评论

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

评论(1

小巷里的女流氓 2024-08-26 12:10:12

我会使用 URLLoader - 我认为这是最轻量级的。

  • 就配置文件而言,URLStream 的复杂性是不必要的。
  • HTTPService 对于这个简单的任务来说又很繁重(并且仅限于 Flex)。当然,它允许您使用最少的代码,但我仅将它用于需要重复更新的内容(将 lastResult 绑定到实时 DataGrid 等) 。
  • myXml.load() - 这不是 AS3,是吗?

I would use URLLoader - I think that's the most lightweight one.

  • The complexity of URLStream is unnecessary as far as a configuration file is concerned.
  • HTTPService again is heavy for this simple task (and Flex only). Of course, it allows you to get away with minimum code, but I use it only for something that needs to be updated repeatedly (binding the lastResult to a live DataGrid etc).
  • myXml.load() - this is not AS3, is it?
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文