Graphics Reference
In-Depth Information
If you need the absolute position of a previously defined label in milliseconds,
this can be determined using the following function:
// Determine the absolute position of a label
var myPos = sym.getLabelPosition (label);
The function sym.getLabelPosition() returns the value undefined if
the value cannot be determined. This can be used to check if a label exists, for
instance.
if (sym.getLabelPosition (label) ) {
alert ("Label does not exist: "+ Label);
}
5.5.3 Calling a URL
For the insertion of external links, we can use the browser JavaScript function.
For example, we can use the following code to open the edgedocks.com web-
site in the same window:
// Navigate to a new URL in the current window
// ("_self" replace with new window through
// corresponding target attribute)
window.open("http://www.edgedocks.com", "_self");
Based on the target attribute "_self" , this will replace our composition with
the target address. If you want to prevent this and open the URL in a new win-
dow or tab, you can use the target attribute "_blank" .
5.5.4 Accessing Symbols
An Edge Animate composition is basically hierarchical. In other words, all sym-
bols are organized in the Stage's tree structure and can be nested in any order.
When you are working in actions, you will often need to navigate through this
tree structure. It is important here to distinguish between elements and symbols.
While symbols are solely defined and accessed through the Edge Animate API,
elements are simply jQuery object references. Let us first look at how we access
symbols. The following section of code comes from a code snippet provided by
Edge Animate.
// Search for JavaScript object for Edge Animate
// symbol in an element that is an instance of a symbol.
 
Search WWH ::




Custom Search