Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

dynamically change button text [Twine 2, SC 2]

$
0
0
Hey everybody,

I'm in need of a button (which triggers an audio play macro), which can be pushed only twice. My go was:
<<set $counter to 1>>
<<set $btntxt to $counter+1 + " more time(s)">>


<span id="btn">
<<button $btntxt>>
	<<set $counter -=1>>
	<<if $counter eq 0>>
	<<replace "#btn">>No more tries!<</replace>>
<<endif>>
<</button>></span>

After two clicks, the replacement macro is correctly triggered, but what do I need to do in order to change the button text after the first click?

Viewing all articles
Browse latest Browse all 1844