Jump to content
Search Community

XMLLoader.content returns String not XML

Tim test
Moderator Tag

Recommended Posts

Hi guys,

I stuck with the problem that the return of my XMLLoader instance is always a String not an XML Object. I try to load a simple xml structure, without any nested LoaderMax etc. calls

I create a LoaderMax instance and append an XMLLoader instance.

In the complete Function i grab the XMLLoader by LoaderMax.getLoader("xmlDoc") , just like in the doc.

var loader:XMLLoader = LoaderMax.getLoader("xmlDoc");
var xml:XML = loader.content; // throw an error: cannot convert to xml
var test:* = loader.content;
trace(typeof(test)); // string

 

Any ideas? Or is there an easier way to get the XML Object.

 

I did try to work with:

var loader:LoaderMax = LoaderMax.getLoader("mainQueue");
var xml:XML = loader.vars.rawXML; // null

 

Thanks and greatings from Berlin,

Tim

Link to comment
Share on other sites

Ok, my bad.

var xml:XML = new XML(loader.content);

 

Anyways in the code hin within FlashBuilder it says:

.content @return -> depending on the Loader -> XMLLoader @return XML

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...