在运行时将 xml 配置文件动态加载到 Flex4/Flash 电影中的最佳方法? [英] Best way to dynamically load an xml configuration file into a Flex4/Flash movie at runtime?

查看:25
本文介绍了在运行时将 xml 配置文件动态加载到 Flex4/Flash 电影中的最佳方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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

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

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

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

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?

推荐答案

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

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

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

这篇关于在运行时将 xml 配置文件动态加载到 Flex4/Flash 电影中的最佳方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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