I use Adobe Edge Animate for simple animations at work. I could not make one of them work and I played a trick. Now I want to know how to do it right.
I have a button. When clicked, it should give play on the timeline from start to finish. If clicked again, it should play backwards from the beginning to the end.
I tried this:
var x=0;
if (x==0){
sym.getSymbol("timeline").play('start');
x=1;
} else {
sym.getSymbol("timeline").playReverse('finish');
x=0 ;
}
This does not work. I do not know where I went wrong. I ended up doing the following:
I created two divs, Symbol1
and Symbol2
. They stand on top of each other. When the first one was clicked, it gave play on the timeline and disappeared (showing the bottom div), so that the second symbol was clicked, giving play reverse. After that the Symbol1
would reappear, restarting the process.
Code:
// Symbol2:
sym.getSymbol("timeline").play('start');
sym.$("symbol2").hide();
// Symbol1:
sym.getSymbol("timeline").playReverse('finish');
sym.$("symbol2").show();
How to make it work? The second mode works but it's double work (doing this for a button is easy, I want to see it done for twenty, which would turn 40, since there are two buttons for each part).