Adding counter variable
hello all-
i know has been discussed numerous times can't seem working!
i'm trying start simple first , here trying accomplish @ time:
i have 3 "rectangle" boxes (on stage), each symbol(names below) , different color.
bluebox
redbox
greenbox
i have 3 "text" boxes above them on stage.
bluecounter
redcounter
greencounter
i have 3 variables in compositionready action on stage:
sym.setvariable("redcount", 0);
sym.setvariable("bluecount", 0);
sym.setvariable("greencount", 0);
what want have happen when click on text box of boxes, box performs animation , number gets incremented one, showing on stage after "text" boxes above:
bluecounter 2
redcounter 5
greencounter 1
i have following code in "onclick" action greencounter text calls appropriately colored box:
sym.$("greenbox").show(); // hidden on stage @ first-this works fine
var counter = sym.getvariable("greencount");
counter++;
sym.$("counter").html("green count: " + counter);
sym.setvariable("greencount", counter);
but, of course, i'm not seeing appear after the "green count:" text on stage (or other two)... (except animation play)...
i know i'm missing elementary , if can figured out, can move on want functionality, , in future :-)
any ideas?
thanks!
james
i have working way:
https://www.box.com/s/cw95qab8kbxtaini1zvl
compostion ready:
sym.setvariable("redcount", 0);
sym.setvariable("bluecount", 0);
sym.setvariable("greencount", 0);
// insert code run when composition loaded here
sym.$('greencounter').click(function(){
sym.$("greenbox").show(); // hidden on stage @ first-this works fine
var counter = sym.getvariable("greencount");
counter++;
sym.$("greencounter").html("green count: " + counter);
});
More discussions in Edge Animate CC
adobe
Comments
Post a Comment