Copy link to clipboard
Copied
Hi, I have an animation with 4 buttons leading to 4 different frames labelled a,b,c and d.
My buttons are named a_btn, b_btn, c_btn, d_btn
Of recent the first button is always giving me a a Error #1009 though it has been working for the last last year in the same animation.
the rest of the buttons work with no problem even though the code is same- help
Usha
Error message:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at hdbcThrombophilia_fla::_5_extrinsicpathway_birdseye_16/frame1()
at flash.display::MovieClip/gotoAndStop()
at hdbcThrombophilia_fla::_5_extrinsicpathway_birdseye_16/fl_ClickToGoToAndStopAtFrame_a()
my code is
a_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_a);
function fl_ClickToGoToAndStopAtFrame_a(event:MouseEvent):void
{
gotoAndStop("a");
}
b_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_b);
function fl_ClickToGoToAndStopAtFrame_b(event:MouseEvent):void
{
gotoAndStop("b");
}
c_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_c);
function fl_ClickToGoToAndStopAtFrame_c(event:MouseEvent):void
{
gotoAndStop("c");
}
d_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_d);
function fl_ClickToGoToAndStopAtFrame_d(event:MouseEvent):void
{
gotoAndStop("d");
}
a_btn is null. ie, it's been defined but is not an object when that error apears.
to remedy, remove what you think is a_btn from all keyframes in its layer. create a new layer, add a_btn to the first keyframe where you want it to appear and assign its instance name. add other keyframes as needed. do not remove&replace a_btn from the stage. that's one way to trigger an error.
p.s. if you click file>publish settings and tick 'permit debugging' the line number triggering the error will be in your
...Copy link to clipboard
Copied
a_btn is null. ie, it's been defined but is not an object when that error apears.
to remedy, remove what you think is a_btn from all keyframes in its layer. create a new layer, add a_btn to the first keyframe where you want it to appear and assign its instance name. add other keyframes as needed. do not remove&replace a_btn from the stage. that's one way to trigger an error.
p.s. if you click file>publish settings and tick 'permit debugging' the line number triggering the error will be in your error message.
Copy link to clipboard
Copied
I am still having the same problem, however it seems like the button
works well when you I test in in browser or as a projector.
It does not work when I test it in animate - which is what I normally do
Find more inspiration, events, and resources on the new Adobe Community
Explore Now