Load local XML file =(

Get help using Construct 2

Post » Wed Aug 07, 2013 5:05 pm

ok, I've gone over all the posts I can find on here, tried to do all the steps that are listed, and for the life of me, I can't get Construct to read the XML file I'm trying to use.

I've drilled down to the simplest possible test I can do and I'm still missing something simple. My expectation is that I would see "found it" on the screen when it runs... but instead, the text still says "text" meaning no change.

Can someone please school me on whatever I'm missing?

I've imported grindmobs.xml to the project

------

my capx is this simple:

1. System (on start of layout) -> AJAX (request grindmobs.xml (tag "grindmobs")

2. AJAX (on "grindmobs" completed) -> XML (Load XML document from string "AJAX.LastData")

3. XML (For each node "bestiary") -> Text (Set text to "found it"

------

And here is the XML file:

<?xml version="1.0"?>
<bestiary>
    
     <enemy>
          <name>Goblin</name>
          <hp>50</hp>
     </enemy>
     
     <enemy>
          <name>Big Goblin</name>
          <hp>75</hp>
     </enemy>

</bestiary>
B
14
S
1
Posts: 20
Reputation: 1,095

Post » Wed Aug 07, 2013 7:25 pm

At this point I've tried multiple other XML files, including the one used in the example, where I learned how to make it work by pasting the XML in as a string.

I've moved on to work on other things, but before I can finish this one, I'll have to solve the problem of reading this from files.Padraik2013-08-08 17:23:38
B
14
S
1
Posts: 20
Reputation: 1,095

Post » Thu Aug 08, 2013 5:38 pm

I finally figured it out - I was right, something simple. Notice that in my AJAX -> on "grindmobs" completed statement I had quotes around AJAX.LastData. Removing those quotes seems to have fixed my problem.Padraik2013-08-08 17:39:16
B
14
S
1
Posts: 20
Reputation: 1,095


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 25 guests