-
-
2. Re: Bind actions
smenegassi Nov 8, 2014 4:53 AM (in response to vivekuma)Hi,
My question was how to bind buttons actions directly from the Stage. It could avoid the problem I exposed on my earlier question : DIVS and Symbols
-
3. Re: Bind actions
joel_pau Nov 8, 2014 6:09 AM (in response to smenegassi)Hi,
You can script as above:
1) an element: sym.$("Rectangle").bind("click", function(){ doSomething() });
2) a class: sym.$(".red").bind("click", function(){ doSomething() });
See : jQuery> .bind()
You can also use symbols.
-
4. Re: Bind actions
vivekuma Nov 8, 2014 6:12 AM (in response to smenegassi)Ok, so lets say stage contains "Symbol_1" which further contains "Symbol_2" which further contains a div element say "Ellipse", then try adding the below code in the stage compositionReady like:
sym.getSymbol("Symbol_1").getSymbol("Symbol_2").$("Ellipse").click(function(){
console.log("Clicked!!!");
});
hth,
Vivekuma
-
5. Re: Bind actions
smenegassi Nov 8, 2014 10:38 AM (in response to vivekuma)Great! thank you vivekuma and joel pau. That is exactly what I wanted to know.






