1

I have an HTML file created in Adobe Edge 5.1. I need to execute a javascript function after stage is initialized and displayed. Is it possible?

Charles
  • 50,943
  • 13
  • 104
  • 142
andr111
  • 2,982
  • 11
  • 35
  • 45

3 Answers3

5

Totally possible. You can tell if a composition is loaded by using the adobe edge bootstrap callback function.

AdobeEdge.bootstrapCallback

Use it like this:

AdobeEdge.bootstrapCallback(function (compId) {
    console.log('composition loaded: ' + compId);    
});

I have more documentation on my site, but if you want to know when the timeline is done as well you could do:

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

From the documentation, it looks like the function is called

when an Edge composition is loaded and ready to play

Here's an example embedded on a site:

<!--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-->
newshorts
  • 1,057
  • 12
  • 12
1

Yes, its possible and use, composition ready event.

sandeep
  • 11
  • 1
0

look for the "Stage" element in the "Elements" panel.

click on the curly braces {} to the left of that element listing. that will take you to the event handlers.

click on the plus (+) button to add a "compositionReady" event handler.

then enter whatever code what you want in the text editor that appears.

henry bemis
  • 490
  • 3
  • 8