2015-11-09 155 views
0

我已禁用边缘动画构图中的自动播放选项。 现在我想将这些动画与waypoints.js绑定,所以我需要通过javascript调用动画。边缘动画:使用javascript播放动画

这是我的HTML

<div id="StageTwo" class="EDGE-4436041"></div> 

这是JavaScript

<script> 
    AdobeEdge.loadComposition('animation_bereitstellung', 'EDGE-4436041', { 
    scaleToFit: "both", 
bScaleToParent: "true", 
    centerStage: "horizontal", 
    minW: "0px", 
    maxW: "undefined", 
    width: "650px", 
    height: "463px" 
}, {"dom":{}}, {"style":{"${symbolSelector}":{"isStage":"true","rect":["undefined","undefined","500px","356px"],"fill":["rgba(255,255,255,1)"]}},"dom":{}}); 
</script> 

的问题:我在一个网站的多个动画。

回答

0

我认为这样做最简单的方法是调用一个bootstrapCallback土坯边缘API类似如下的方式:

var waypoint = new Waypoint({ 
    element: document.getElementById('basic-waypoint'), 
    handler: function() { 

    window.AdobeEdge.bootstrapCallback(function(compId) { 

     var comp = AdobeEdge.getComposition("EDGE-4436041"); 

     //either to play the stage 
     var stage = comp.getStage().play(); 

     //or to play a symbol inside the stage 
     var mySymbol = comp.getStage().getSymbol("symbol"); 
     mySymbol.play(); 

    }); 

    } 

}); 

希望帮助!