Skip to main content
Participant
August 30, 2010
Answered

Why does this Event Listener stop listening?

  • August 30, 2010
  • 1 reply
  • 963 views

I have built a flash movie that is located here:

http://faithkealadesign.com/get_files/blueflairphotography/index.html

For some reason after the timeline plays through completly (after the "headshots and potfolios" slide) the listener on the "child and family portraits" button stops listening or responding. Why is that? All the other event listeners are behaving themselves except this one?

Any advice?


Here is the actionscript:

McChild.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler);

function fl_MouseOverHandler(event:MouseEvent):void
{
    gotoAndStop(65);
    trace("Moused over");
}

McChild.addEventListener(MouseEvent.MOUSE_OUT, fl_MouseOutHandler);

function fl_MouseOutHandler(event:MouseEvent):void
{
    gotoAndPlay(71);
    trace("Moused out");
}

McChild.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage);

function fl_ClickToGoToWebPage(event:MouseEvent):void
{
    navigateToURL(new URLRequest("http://blueflairphotography.com/index2.php?v=v1"), "_blank");
}

McMaternity.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler2);

function fl_MouseOverHandler2(event:MouseEvent):void
{
    gotoAndStop(81);
    trace("Moused over");
}

McMaternity.addEventListener(MouseEvent.MOUSE_OUT, fl_MouseOutHandler2);

function fl_MouseOutHandler2(event:MouseEvent):void
{
    gotoAndPlay(100);
    trace("Moused out");
}
McMaternity.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage2);

function fl_ClickToGoToWebPage2(event:MouseEvent):void
{
    navigateToURL(new URLRequest("http://blueflairphotography.com/index2.php?v=v1"), "_blank");
}

McSeniors.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler3);

function fl_MouseOverHandler3(event:MouseEvent):void
{
    gotoAndStop(110);
    trace("Moused over");
}

McSeniors.addEventListener(MouseEvent.MOUSE_OUT, fl_MouseOutHandler3);

function fl_MouseOutHandler3(event:MouseEvent):void
{
    gotoAndPlay(131);
    trace("Moused out");
}
McSeniors.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage3);

function fl_ClickToGoToWebPage3(event:MouseEvent):void
{
    navigateToURL(new URLRequest("http://YouNIQUEbyBlueFlair.com"), "_blank");
}

McBlog.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler4);

function fl_MouseOverHandler4(event:MouseEvent):void
{
    gotoAndStop(141);
    trace("Moused over");
}

McBlog.addEventListener(MouseEvent.MOUSE_OUT, fl_MouseOutHandler4);

function fl_MouseOutHandler4(event:MouseEvent):void
{
    gotoAndPlay(162);
    trace("Moused out");
}
McBlog.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage4);

function fl_ClickToGoToWebPage4(event:MouseEvent):void
{
    navigateToURL(new URLRequest("http://blueflairphotoblog.com/"), "_blank");
}

McBoudoir.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler5);

function fl_MouseOverHandler5(event:MouseEvent):void
{
    gotoAndStop(172);
    trace("Moused over");
}

McBoudoir.addEventListener(MouseEvent.MOUSE_OUT, fl_MouseOutHandler5);

function fl_MouseOutHandler5(event:MouseEvent):void
{
    gotoAndPlay(193);
    trace("Moused out");
}
McBoudoir.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage5);

function fl_ClickToGoToWebPage5(event:MouseEvent):void
{
    navigateToURL(new URLRequest("http://HAUTEbyBlueFlair.com"), "_blank");
}

McWeddings.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler6);

function fl_MouseOverHandler6(event:MouseEvent):void
{
    gotoAndStop(203);
    trace("Moused over");
}

McWeddings.addEventListener(MouseEvent.MOUSE_OUT, fl_MouseOutHandler6);

function fl_MouseOutHandler6(event:MouseEvent):void
{
    gotoAndPlay(222);
    trace("Moused out");
}
McWeddings.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage6);

function fl_ClickToGoToWebPage6(event:MouseEvent):void
{
    navigateToURL(new URLRequest("http://blueflairphotography.com/index2.php?v=v2"), "_blank");
}

McHeadshots.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler7);

function fl_MouseOverHandler7(event:MouseEvent):void
{
    gotoAndStop(232);
    trace("Moused over");
}

McHeadshots.addEventListener(MouseEvent.MOUSE_OUT, fl_MouseOutHandler7);

function fl_MouseOutHandler7(event:MouseEvent):void
{
    gotoAndPlay(253);
    trace("Moused out");
}
McHeadshots.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage7);

function fl_ClickToGoToWebPage7(event:MouseEvent):void
{
    navigateToURL(new URLRequest("http://blueflairphotography.com/index2.php?v=v1"), "_blank");
}

This topic has been closed for replies.
Correct answer Ned Murphy

If the event listeners work to start with, then it is not likely a problem with the code, though it could be a problem with a lack of code.  Do you change frames such that new instances of the button are encountered in keyframes?

1 reply

Ned Murphy
Ned MurphyCorrect answer
Legend
August 30, 2010

If the event listeners work to start with, then it is not likely a problem with the code, though it could be a problem with a lack of code.  Do you change frames such that new instances of the button are encountered in keyframes?

FaithHarkAuthor
Participant
August 30, 2010

Thanks, Ned! Your reply helped me look in the right place. It wasn't the code at all. The instance was missing frome one little frame at the end of the timeline and that was causing the listener to stop responding after that frame was passed on the timeline.

Ned Murphy
Legend
August 30, 2010

You're welcome