I'm looking for an easier way to apply rollover effects (different states for symbols) to multiple symbols at once. I know how to do this to each individual symbol but I'm wondering if there's a faster way to apply the effect to multiple symbols.
Give them a class name. example calls myIcons
use in compositionReady.
sym.$(".myIcons").bind('mouseenter",function(){
// do something
});
Make sure you have the period before the class name!!!
Hi,
You can also use: sym.getComposition().getSymbols("symbolName");
For example:
The library panel has a symbol named "Button".
All buttons require a click event.
sym.getComposition().getSymbols("Button").forEach( function(item){
console.log( item );
item.getSymbolElement().bind( "click", function(e){ console.log( e.target + " has been clicked"); });
});
Now, if the goal of the click event is to play a label.
sym.getComposition().getSymbols("Button").forEach( function(item){
item.getSymbolElement().bind( "click", function(){ item.play("aLabel"); });
});
A sample: button events.zip - Box