Graphics Reference
In-Depth Information
For dynamic compositions in which the number of symbol instances is not
static, it may be necessary to determine all the Stage's child symbols during run-
time. This can occur if the user is able to create symbols through actions during
runtime. In such a scenario, it may be necessary to check or prevent issues such
as collisions among elements (see section 7.5). For these cases, each symbol has
the getChildSymbols() function with which you can get references to any
child symbol as an array.
// Find all child symbols
var symbolArray = sym.getChildSymbols();
If you want to stop all child symbols, use the following script:
// Stop all direct child symbols
var symbolArray = sym.getChildSymbols();
for(var i=0; i<symbolArray.length; i++) {
symbolArray[i].stop();
}
5.5.5 Accessing Elements
As already described, the visual components of a symbol consist of elements
that are represented by a jQuery object. This means you can also access individ-
ual elements with jQuery syntax. Since each element is ultimately located within
a symbol, namely in the Stage itself or in a symbol within the Library, elements
can also be accessed through the parent symbol. The typical jQuery selector
syntax with the $ sign is used to access an element:
sym.$("ElementName");
However, the only difference to a classic jQuery selector is that neither the
class (.) nor the Id prefix (#) is required. This is because the function provided
through the $() symbol is not identical to the actual jQuery function, but rather,
makes this available in an expanded form. The actual IDs stored in the DOM are
much longer. They begin with the prefix “Stage_” and add it as another identifier
to each level in the symbol tree hierarchy. Thus, the actual ID of an element
(“MyElement”), which is contained within a symbol (“MySymbol”) on the Stage
is as follows:
Stage_MySymbol_MyElement
In order not to lose track, we do not need to use Edge Animate's selector
function on the actual path. You only need to specify the element name.
 
Search WWH ::




Custom Search