Adobe Edge Animate: How to get the current Symbol time?

In Adobe Edge Animate, how do I get the current character time?

I use a combination of jQuery and Adobe Edge codes to program my page. I want to check if the character time remains in the first frame (if in the Flash concept).

$(window).scroll(function(e) { var the_stage = $.Edge.getComposition("EDGE-123456").getStage(); var sym = the_stage.getSymbol(id); // how to get current time ? }); 
+4
source share
2 answers

Finally found a solution. To get the current time, use:

 var pos = sym.getPosition() 

pos is an integer. If a symbol has not been reproduced before, its value is -1 , otherwise it is a position in milliseconds.

+6
source

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; /* expressed in milliseconds */ $.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; /* expressed in milliseconds */ $.Edge.getComposition(animation).getStage().stop(jumpPosition); 

That way, when you call play (), the animation starts at position 300.

+2
source

All Articles