0 votes
by (120 points)
Hi, I'm trying to make it so the link leading to the next passage displays an alert. When the alert displays and you click OK on the box that appears, is there a way to make it go to the next passage?

1 Answer

0 votes
by (44.7k points)

If you're talking about using the JavaScript alert() function, then you should be able to just do this:

<<button "Modal alert test">>
	<<run alert("Message")>>
	<<goto [[Next Passage]]>>
<</button>>

Which would display the message when you click that button, and it would only go to the "Next Passage" passage after you closed the alert window.

Just be careful when using the <<goto>> macro, because it will continue to execute any lines of code after it, even though it's already bringing up the passage you tell it to go to.

Hope that helps!  :-)

...