Your decision is in order, but you need to clarify.
If your animation is inside the div:
<div id="stage_animation_0" class="animation_0"></div>
I suggest calling the class attribute with the attribute "animation_" + animation and the id attribute with the name "stage_" + class.
Get
You can get the actual position of the timeline this way:
var getAnimationPos = function(animation) { var stage = $.Edge.getComposition(animation).getStage(); var sym = stage.getSymbol("stage_" + animation); return sym.getPosition(); }
So you can get your timeline with:
var position = getAnimationPos("animation_0");
SET
Setting the actual position of the timeline is more "complicated."
If your animation is playing and you want to go to a specific position:
var jumpPosition = 300; $.Edge.getComposition(animation).getStage().play(jumpPosition);
If your animation is paused and you want to set a position without a game, you need to:
var jumpPosition = 300; $.Edge.getComposition(animation).getStage().stop(jumpPosition);
That way, when you call play (), the animation starts at position 300.
source share