XML Load事件触发时需要返回一个值actionscript
Actionscript 真的让我压力很大!我的代码太混乱了,无法发布,因为我已经尝试了从设计模式到程序方法的所有内容。简而言之,有什么方法可以在加载 URL 请求后检索变量中的 XML 数据吗?
var req:URLRequest = new URLRequest(url);
this.loader = new URLLoader(req);
this.loader.addEventListener(Event.COMPLETE, readXML);
基本上我试图捕获我的 XML 输出,以便我可以将其放在一个列表中。似乎没有办法将其分配给变量而不在事件结束时失去作用域。
Actionscript is really stressing me out! My code is too messy to post as I have tried everything from design patterns to procedural approaches. In short, is there any way i can retrieve my XML data in a variable after loading the URL request?
var req:URLRequest = new URLRequest(url);
this.loader = new URLLoader(req);
this.loader.addEventListener(Event.COMPLETE, readXML);
Basically I am trying to capture my XML output so I can place it a list. There doesn't seem to be a way to assign it to a variable without it losing scope when the event is over.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 readXML 函数中,您可以将 xml 写入 var
in your function readXML you can write the xml into a var