removeEventListener in another timeline frame for html canvas
Hi!
I really do not know the advice. I work with Adobe Animate canvas. I need to turn on the eventlistener inside the movieclip in frame 2 of its timeline, and turn it off in frame 3 of its timeline. On frame 3 I go through the canvas button. But the removeeventlistener works only in the frame where the listener was defined.
In frame 2 I have this code:
aliasRozne = Rozne.bind (this);
this.addEventListener ("tick", aliasRozne);
function Rozne ()
{
frame = frame + 1
if (frame == 50)
{
this.svetlo1.visible = true;
}
if (frame == 250)
{
this.svetlo5.visible = true;
this.removeEventListener ("tick", aliasRozne);
}
}
In frame 3 I have this code:
this.removeEventListener ("tick", aliasRozne);
But the listener does not turn off in frame 3 and frame is still increasing. When I stay on frame 2, everything is ok.
Do you have any advice?
Thanks!
