Adobe Edge上载事件

and*_*111 1 javascript adobe-edge

我在Adobe Edge 5.1中创建了一个HTML文件。在阶段初始化并显示后,我需要执行一个javascript函数。可能吗?

new*_*rts 5

完全有可能。您可以使用adobe edge bootstrap回调函数判断是否加载了合成。

AdobeEdge.bootstrapCallback
Run Code Online (Sandbox Code Playgroud)

像这样使用它:

AdobeEdge.bootstrapCallback(function (compId) {
    console.log('composition loaded: ' + compId);    
});
Run Code Online (Sandbox Code Playgroud)

我的网站上有更多文档,但是如果您想知道时间表的完成时间,则可以执行以下操作:

AdobeEdge.bootstrapCallback(function (compId) {
            console.log('composition loaded: ' + compId);    
            AdobeEdge.Symbol.bindTimelineAction(compId, "stage", "Default Timeline", "complete", function(sym, e) {
                console.log('timeline complete');
            });
        });
Run Code Online (Sandbox Code Playgroud)

文档看来,该函数被称为

加载Edge合成并准备播放时

这是网站上嵌入的示例:

<!--Adobe Edge Runtime-->
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <script type="text/javascript" charset="utf-8" src="edge/specialized/edge_includes/edge.5.0.1.min.js"></script>
    <style>
        .edgeLoad-EDGE-150750921 { visibility:hidden; }
    </style>
    <script>
       AdobeEdge.loadComposition('edge/specialized/specialized', 'EDGE-150750921', {
            scaleToFit: "none",
            centerStage: "horizontal",
            minW: "0",
            maxW: "undefined",
            width: "550px",
            height: "309px"
        }, {dom: [ ]}, {dom: [ ]});

        AdobeEdge.bootstrapCallback(function (compId) {
            console.log('composition loaded: ' + compId);    
            AdobeEdge.getComposition(compId).load("edge/specialized/specialized_edgeActions.js");

            // do some other stuff on the page
        });
    </script>
    <!--Adobe Edge Runtime End-->
Run Code Online (Sandbox Code Playgroud)