remove event listeners
hi, i have 5 buttons, only one is the correct and leads to the next frame, the others shows a wrong message,
the problem is, in the next frame, i wanted to do all the same but change one button, but i cant remove the event listeners of the code from the previous frame,
i look many forums and videos, and all the code i tried didn't work,
wonder if someone could help, heres the code:
stop();
ex1.stop();
ex2.stop();
ex3.stop();
ex4.stop();
ex5.stop();
//p1
p1.addEventListener(MouseEvent.CLICK, goP1);
function goP1(event:MouseEvent):void
{
ex1.play();
}
//p2
p2.addEventListener(MouseEvent.CLICK, goP2);
function goP2(event:MouseEvent):void
{
ex2.play();
}
//p3
p3.addEventListener(MouseEvent.CLICK, goP3);
function goP3(event:MouseEvent):void
{
ex3.play();
}
//p4
p4.addEventListener(MouseEvent.CLICK, goP4);
function goP4(event:MouseEvent):void
{
Object(root).gotoAndStop(12)
}
//p5
p5.addEventListener(MouseEvent.CLICK, goP5);
function goP5(event:MouseEvent):void
{
ex5.play();
}
