Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Hi, Error #1009

Community Beginner ,
Nov 17, 2017 Nov 17, 2017

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");
}

285
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 17, 2017 Nov 17, 2017

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

...
Translate
Community Expert ,
Nov 17, 2017 Nov 17, 2017

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 17, 2017 Nov 17, 2017
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines