Question
TypeError?
I have a movie-clip with a roll-over,roll-out and on-click
function; a pretty simple button. When I test my movie the button
works just fine and when it is clicked the movie continues.
However, when I click the button an error messages also appears.
Below is the error I receive and the code applied to my movie-clip.
Any thoughts on this error message?
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at career_flash_fla::MainTimeline/rollOutFunc()
********************************************************************************************
stop();
start_btn.buttonMode = true;
start_btn.addEventListener(MouseEvent.ROLL_OVER, rollOverFunc);
start_btn.addEventListener(MouseEvent.ROLL_OUT, rollOutFunc);
start_btn.addEventListener(MouseEvent.CLICK, clickFunc);
function rollOverFunc(event:MouseEvent):void
{
start_btn.gotoAndPlay(2);
}
function rollOutFunc(event:MouseEvent):void
{
start_btn.gotoAndPlay(7);
}
function clickFunc(event:MouseEvent):void
{
play();
}
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at career_flash_fla::MainTimeline/rollOutFunc()
********************************************************************************************
stop();
start_btn.buttonMode = true;
start_btn.addEventListener(MouseEvent.ROLL_OVER, rollOverFunc);
start_btn.addEventListener(MouseEvent.ROLL_OUT, rollOutFunc);
start_btn.addEventListener(MouseEvent.CLICK, clickFunc);
function rollOverFunc(event:MouseEvent):void
{
start_btn.gotoAndPlay(2);
}
function rollOutFunc(event:MouseEvent):void
{
start_btn.gotoAndPlay(7);
}
function clickFunc(event:MouseEvent):void
{
play();
}