How to use the typewriter effect with text from an XML file?

Get help using Construct 2

Post » Thu Feb 23, 2017 2:47 pm

Hello,

As the title suggests, I am trying to get text from an XML and display it using typewriter effect.
This is what I've done so far:

Start of Layout ---> Request Intro.xml
AJAX on "Intro" completed ---> Load XML from AJAX.LastData
Set text to xml.StringValue("chapter1/hint[@id='intro1']/text()")
Every 0.1 seconds ----> Set text to left(TextObj.Text, len(TextObj) + 1)
On click ------------------> Add 1 to TextProgress
Compare 2 Values:
xml.StringValue("/chapter1/hint[@id='intro"&Stage&"']/text()")
Equal to ""
----------------> Set text to "continue"
Else --------------------->Set text to "xml.StringValue("/chapter1/hint[@id='intro"&Stage&"']/text()")"

But it doesn't work.
Can someone please help me?
@coyowl

coyowl.com

Game studio with a portfolio of 3 Apple Featured games.
B
31
S
7
G
2
Posts: 111
Reputation: 2,417

Post » Mon Feb 27, 2017 1:13 pm

bump
@coyowl

coyowl.com

Game studio with a portfolio of 3 Apple Featured games.
B
31
S
7
G
2
Posts: 111
Reputation: 2,417

Post » Tue Feb 28, 2017 12:12 am

Is there any reason you are using XML and not JSON?
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,415
Reputation: 4,824

Post » Tue Feb 28, 2017 10:42 am

No but I don't know if that's helping.
Is JSON going to be easier?
@coyowl

coyowl.com

Game studio with a portfolio of 3 Apple Featured games.
B
31
S
7
G
2
Posts: 111
Reputation: 2,417

Post » Wed Mar 01, 2017 1:00 pm

skozax depend how good you are with both lingo
B
250
S
39
G
15
Posts: 1,953
Reputation: 40,623

Post » Wed Mar 01, 2017 1:23 pm

korbaach wrote:XML2Speach.capx
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Wed Mar 01, 2017 5:40 pm

JSON is far easier to work with than XML, and there are lots of nice JSON plugins, like @Yann 's or @rex_rainbow 's JSON and map plugins.
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,415
Reputation: 4,824

Post » Thu Mar 02, 2017 9:06 am

Thank you all for your replies!
I was wondering, is there a way to make the text from a XML a link? For example, is it possible to have a word highlighted so OnClick it will redirect to a webpage?
@coyowl

coyowl.com

Game studio with a portfolio of 3 Apple Featured games.
B
31
S
7
G
2
Posts: 111
Reputation: 2,417

Post » Mon Mar 06, 2017 6:19 pm

skozax wrote:Thank you all for your replies!
I was wondering, is there a way to make the text from a XML a link? For example, is it possible to have a word highlighted so OnClick it will redirect to a webpage?


In what context? Your Construct app? Or a website in general?
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,415
Reputation: 4,824

Post » Tue Mar 07, 2017 7:43 am

Yes, in the C2 app
@coyowl

coyowl.com

Game studio with a portfolio of 3 Apple Featured games.
B
31
S
7
G
2
Posts: 111
Reputation: 2,417

Next

Return to How do I....?

Who is online

Users browsing this forum: sean080, Yahoo [Bot] and 17 guests