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?
Asked
Active
Viewed 2,636 times
3 Answers
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
-
thanks for answer and for contributing to the stack! Can you provide a little more detail though (links, code snippets, explanation, etc.)? – Zachary Kniebel Oct 21 '12 at 17:54
-
I added some more documentation below – newshorts Apr 26 '15 at 00:32
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