Skip to main content
Inspiring
September 5, 2014
Question

Unable to load external XML-file on iOS-device (ioError) (urgent!)

  • September 5, 2014
  • 0 replies
  • 282 views

I try to load an external xml-file from a server, but until now, I didn't manage.

Locally it loads, but when on a server, it doesn't.

In the root of the domain I placed a crossdomain.xml containing:

<?xml version="1.0"?>

<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">

<cross-domain-policy>

<site-control permitted-cross-domain-policies="all" />

<allow-access-from domain="*" />

<allow-http-request-headers-from domain="*" headers="*"/>

</cross-domain-policy>

And in Flash I use this (most simplified) code:

import flash.display.Sprite;

import flash.errors.*;

import flash.events.*;

import flash.net.URLLoader;

import flash.net.URLRequest;

var request: URLRequest = new URLRequest("http://www.zinder.nl/nivoContentLive.xml");

var loader: URLLoader = new URLLoader();

loader.addEventListener(Event.COMPLETE, completeHandler);

try {

    loader.load(request);

} catch (error: ArgumentError) {

    trace("An ArgumentError has occurred.");

} catch (error: SecurityError) {

    trace("A SecurityError has occurred.");

}

function completeHandler(event: Event): void {

    var dataXML: XML = XML(event.target.data);

    trace(dataXML.toXMLString());

}


This is the error I receive:

Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: http://www.zinder.nl/nivoContentLive.xml

It's a pretty urgent issue, so hope someone can help

This topic has been closed for replies.