Graphics Reference
In-Depth Information
Figure 7.11
The Edge Commons composition loader
enables the nesting of compositions
4 Project
The files for this example can be
downloaded from http://edgebuch.
simonwidjaja.com
Project Name:
Advanced_CompositionLoader
In the “Outer.html” composition, the symbol named “TargetContainer” is posi-
tioned on the Stage. A click on the button loads the second composition. Once we
load Edge Commons as described above, we can use the loadComposition()
function to start the loading of the compositions:
var targetContainer = sym.getSymbol("TargetContainer");
EC.loadComposition("Inner.html", targetContainer)
.done(function(comp) {
comp.getStage().$("title").html("Hello Ani!");
});
Via the optional function cascade, we can also add a done() function that ex-
ecutes as soon as the composition is successfully loaded. This function contains
the comp parameter with which we can control the composition's Timeline or
fill in text elements with text. Thus, this function not only enables the nesting of
compositions in any order, it also enables them to communicate.
Figure 7.12
The loaded composition seamlessly fits
into the parent com position
 
Search WWH ::




Custom Search