How do I load xml string from AJAX.LastData?

0 favourites
  • 3 posts
  • I checked out the XML example .capx and it looked pretty straightforward. So I created a new project file with the same info in it as the xml string in the example, loaded it via AJAX, and then attempted to load AJAX.LastData as the XML string, but i'm not getting anything to parse through. In debug if i look at the AJAX object I see the correct project file string in there. Any ideas?

    [attachment=0:23lfdfx5][/attachment:23lfdfx5]

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You say your project file has the same info as the xml string in the example. Did you remove the extra quotation marks?

    When you load from string the xml is wrapped in double quotes and double quotes inside the xml are escaped with extra double quotes:

    "<?xml version=""1.0"" ?> ..."[/code:pwrgjhb8]
    But in the file you should just have:
    [code:pwrgjhb8] <?xml version="1.0" ?> ...[/code:pwrgjhb8]
  • THANK YOU! That did it. I had removed the quotes surrounding the whole thing, but didn't even consider removing the double quotes. THANKS!

    A second question, if you don't mind. While trying to solve this problem I read some worrisome things about xml not being supported by some export options Construct 2 has. Like CocoonJS, and some others. Is that something I should worry about? Should I switch to a different format? Like JSON?

    Thanks!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)