Graphics Reference
In-Depth Information
<style>
.edgeLoad-COMPOSITION_B { visibility:hidden; }
</style>
<!--Adobe Edge Runtime End-->
</head>
<body style="margin:0;padding:0;">
<div id="Stage" class="COMPOSITION_A"></div>
<div id="StageB" class="COMPOSITION_B"></div>
</body>
</html>
In this method, make sure to change the IDs of the DIV container for the two
stages. You may use any name, but it must be unique and can only be used
once within the document. As described above, direct access to CompositionA
within CompositionB would likely not produce any results and cause an error
because there is no guarantee that CompositionA is already fully loaded when
the function is called. This is where the bootstrap callback, which you can define
with Adobe Edge.bootstrapCallback() , comes into play. For this purpose,
first create a new script block in the head segment of the HTML document. In
this script block, define an empty object named loadedComps in which you
can later store the references to the compositions. In the second step, define the
actual bootstrap callback by creating a function with the parameter compId .
This function is executed every time a composition is loaded in the document.
In this example, the callback will be called twice in a row. Since we cannot pre-
dict which composition is loaded first, save the composition that has just loaded
in the loadedComps object. The following if statement checks whether both
compositions are available. If this is not the case, then nothing happens and
there is a wait for the next composition. Once both compositions are available,
register an action for the button inside the green composition. To do this, use
the bindElement() function. Within the action, you get the reference to
CompositionA. Use the play() function on the Stage so that the animation is
played. The final script block looks as follows.
<script>
var loadedComps = {};
AdobeEdge.bootstrapCallback( function(compId) {
loadedComps[compId] = AdobeEdge.
getComposition(compId);
if (loadedComps['COMPOSITION_A']
&& loadedComps['COMPOSITION_B']) {
AdobeEdge.Symbol.bindElementAction(compId,
"stage", "${_playButton}", "click",
 
Search WWH ::




Custom Search