开发者

External XML using AS3.0 [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. 开发者_如何学Python

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 4 years ago.

Improve this question

How can I load external xml file in Action Script 3.0, I have seen a tutorial http://webdeginer.blogspot.com/2010/06/external-xml-loading.html, is it right or I have to see any more tutorials?


If you're trying to link to your own blog as "just a blog I happened to see on the web", the bare minimum you should do is to make sure that blog name and your screen-name in SO are different.

That said, the code over there is not listening for io-error and security-error which a URLLoader throws when it fails to locate the URL and when the URL isn't accessible due to security domain violations respectively. If you don't handle those events, Flash player will throw unhandled error and you might not even know that unless you're working on debug version of Flash player.

xmlob.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
xmlob.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
function securityErrorHandler(e:SecurityErrorEvent):void
{
  trace("security error occurred:\n" + e);
}
function ioErrorHandler(e:IOErrorEvent):void
{
  trace("io error occurred:\n" + e);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜