Hi,
I'm currently working on an animation and I would like it's be controled in external JS files through the bindTriggerAction method and his callback function.
In Edge Animate context, the following code is actually working:
(function ($, Edge, compId) {
var Composition = Edge.Composition, Symbol = Edge.Symbol; // alias pour les classes Edge couramment utilisées
//Edge symbol: 'stage'
(function (symbolName) {
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1000, function (sym, e) {
console.log("test");//called
});
//Edge binding end
})("stage");
//Edge symbol end:'stage'
})(jQuery, AdobeEdge, "EDGE-9033193");
Next, I tried to export/adapt this code to run it outside of the Edge Animate context:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<!--Adobe Edge Runtime-->
<script type="text/javascript" charset="utf-8" src="test_001_edgePreload.js"></script>
<style>.edgeLoad-EDGE-9033193 { visibility:hidden; } </style>
<!--Adobe Edge Runtime End-->
</head>
<body>
<div id="Stage" class="EDGE-9033193">
</div>
<script type="text/javascript">
AdobeEdge.bootstrapCallback(function (compId) {
AdobeEdge.Symbol.bindTimelineAction(compId[0], "stage", "Default Timeline", "complete", function (sym, e) {
console.log("complete...");//OK
});
//my animation is 5000ms long
AdobeEdge.Symbol.bindTriggerAction(compId[0], "stage", "Default Timeline", 1000, function (sym, e) {
console.log("test");//never called...
});
});
</script>
</body>
</html>
In my second test, you'll notice that the bindTimelineAction callback works but the method bindTriggerAction callback function is no longer called and I just can't figure why.
If someone has an idea, that's would be great !