I'm still new at code and need help with resetting an animated symbol
I used Elaine's tutorial "Leveraging Independent Symbol Timelines" to create 3 animated buttons that display on a page when clicking a 1 of my 4 menu options. The buttons work great however, they will not reset. When I click on one of the other 3 menu options (which jumps to another timline position where the symbols are not visible) and then come back to the menu with the buttons, the last played symbol animation doesn't reset. I want the symbols to reset to the way they were when i first visited the page any time I leave that section and come back. I tried using the code below for the click action on each one of my other 3 menus but it keeps autoplaying the symbol animations?
sym.getSymbol("myButton1").play(0);
sym.getSymbol("myButton2").play(0);
sym.getSymbol("myButton3").play(0);
Here's the code I'm using for each of my buttons:
var current = sym.getVariable("current");
if (current != "") {
sym.getSymbol(current).play("out");
sym.getSymbol("myButton").play("in");
}
else {
sym.getSymbol("myButton").play("in");
}
sym.setVariable("current", "meButton");
Here's what I have for my Stage (compositionReady):
sym.setVariable("current","");
I greatly appreciate your help!!!