In Animate HTML5 canvas on named last frame of movie clip gotoAndStop on named main timeline frame
I have a movie clip on stage on top of a graphic. When the main timeline movie gets to this frame it stops and plays the nested movie clip. I want to code from the main timeline actionscript layer an event listener that detects when the last named frame of the nested clip is played and goto and stop on a named frame of the main timeline.
So, for example.
On frame 30 which is named "question_1" is a button click event listener that goes to the next frame "question1_answer1":
this.q1f1.addEventListener("click", fl_MouseClickHandler.bind(this));
function fl_MouseClickHandler()
{
this.gotoAndStop("question1_answer1");
}
on "question1_answer1" there is a "this.stop();" and a movie clip on the stage named "qchicken" that runs an animation. On the last frame of "qchicken" I have named the frame "chicken_down" at which point I want to go back to "question_1" on the main timeline. So how do I write an event listener that does this:
this.qchicken.EVENT LISTENER THAT DETECTS WHEN "chicken_down" IS REACHED.parent.gotoAnd Stop("question_1");
And finally, how and where do I put the remove event listener code once the goto is executed (and similarly once a button is pressed on other events)? I've seen more than one variation of writing remove event listener in posts and examples of it being placed before and after the event code. Which is correct?
