I am trying to stop a sound on a close button.
I can get .pause to work - but .stop does'nt work at all.
( i want it so if somebody closed a symbol and then reopens it - it will start from the beginning.
This is the code i am using on my close button:
var audio1 = sym.getVariable("audio1");
Does anyone has a solution?!
This is not the correct code. A sound file is referenced like this:
var audio1 = sym.$("audio1");
if your audio is on the main stage.
If your audio is inside the symbol then you need to reference the scope
var audio1 = sym.getSymbol('symbolName').$("audio1");
if you want to pause use this:
if you want to play again from the beginning use this:
audio1.currentTime = 0;