views:

19

answers:

1

Hi,

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.

Thanks, K Swamy Vishnubhatla, webdeginer.blogspot.com.

+3  A: 

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);
}
Amarghosh