How do I inplement javascript $each() in C2?

Get help using Construct 2

Post » Thu Jan 26, 2017 3:20 pm

In the example below in Edge Animate*, a different image is loaded according to what button is clicked. How could I implement that in C2?
* Edge Animate uses a slightly modified javaScript where sym is the stage symbol. The individual button elements are all children of the div.

I do not seem to find a way to address a series of buttons in this way.

Code: Select all
var buttons = sym.$("buttons").children();     

   $(this).on("click", function(){
         // do something when one of the button is clicked   
         sym.$("images").animate({"opacity":1.00},700).attr('src',"images/image" + i + ".png");            
Posts: 96
Reputation: 684

Return to How do I....?

Who is online

Users browsing this forum: Elliott and 9 guests