在运行时将 xml 配置文件动态加载到 Flex4/Flash 影片中的最佳方法?
我有一个关于在运行时在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会使用 URLLoader - 我认为这是最轻量级的。
URLStream
的复杂性是不必要的。HTTPService
对于这个简单的任务来说又很繁重(并且仅限于 Flex)。当然,它允许您使用最少的代码,但我仅将它用于需要重复更新的内容(将lastResult
绑定到实时DataGrid
等) 。myXml.load()
- 这不是 AS3,是吗?I would use URLLoader - I think that's the most lightweight one.
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 thelastResult
to a liveDataGrid
etc).myXml.load()
- this is not AS3, is it?