setInterval in compositionReady
hi everybody,
i hope can me problem:
i want use setinterval repeat function defined in compositionready doesn't work:
var count = 0.;
var counter_pos = setinterval(countclicks, 200.);
sym.countclicks = function()
{
count = count + 1;
if (count > 10.)
count = 1.;
sym.$("dymtext").html(count);
}
button code: sym.getcomposition().getstage().countclicks();
but:
the setinterval works fine using click command of button:
var count = 0.;
var counter_pos = setinterval(countclicks, 200.);
function countclicks()
{
count = count + 1;
if (count > 10.)
count = 1.;
sym.$("dymtext2").html(count);
}
what's wrong setinterval in compositionready?
thanks help!
that's because in second option you're using "countclicks" global variable it's defined , recognizable everywhere in first option you're defining function exclusive symbol using "sym.countclicks",
so in first code option , either remove "sym" "sym.countclicks = function()" or add "sym" when call function , "setinterval(sym.countclicks, 200.);"
cheers!
More discussions in Edge Animate CC
adobe
Comments
Post a Comment