Toggle button state


I’m having difficulty making a button turn green on first press, then turning that same button back to its original colour on a subsequent press. Any ideas?

When the play or stop button are pushed several times, iBooks crashes
(stephen) #2

This will require a bit of javascript:

if (!window.isButtonGreen) {
	window.isButtonGreen = true;
	hypeDocument.continueTimelineNamed('green', hypeDocument.kDirectionForward);
} else {
	window.isButtonGreen = false;
	hypeDocument.continueTimelineNamed('green', hypeDocument.kDirectionReverse);

The ‘green’ timeline would just animate the button to green.