Total newbie here looking for a bit of a hand!
I want to create an embedded audio file which I can play and pause and resume with a mouse click using the same link. I have added three actions to the link properties window - play, pause, resume but every 2nd click just plays the audio from the start again. Is there anyway to do this with javascript
Cheers for any help
Aaron
To rotate actions on the same button, a software construction called a state machine is necessary. The statemachine keeps track of what the last action was and controls wich action is next. Here's a simple one in JavaScript that could be placed on a button's Mouse Up action.
I haven't tested this code, so use it at your own risk. It assumes the audio is in a sound object, not a multimedia object.
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script