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

First button not working

Community Beginner ,
Nov 17, 2017 Nov 17, 2017

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

Views

472

Translate

Translate

Report

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 22, 2017 Nov 22, 2017

Hi Usha!

I took a look at your file...very complicated.... first off... its a good idea to ALWAYS use different instance names for your buttons.... and different label names for your labels. Im actually surprised you do not have more errors.

This is a very simple fix.... if you look at your file you will see the your A label is the ONLY label that ALSO has a STOP ACTION ON IT....

so when in b or c... and you click A... a says go to and PLAY a... but on a is a STOP action....

so I just moved the A

...

Votes

Translate

Translate
Adobe Employee ,
Nov 17, 2017 Nov 17, 2017

Copy link to clipboard

Copied

Not the exact solution to your issue, but have a look at this article https://code.tutsplus.com/tutorials/quick-tip-how-to-debug-an-as3-error-1009--active-9354 for insights

Votes

Translate

Translate

Report

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 Expert ,
Nov 20, 2017 Nov 20, 2017

Copy link to clipboard

Copied

Hello,

check to see what frame the code is on... and in that same frame... make sure that ALL the instances of these buttons are also on the stage on that same frame, and of course make sure it has the correct instance name. But its letting you know that it is not able to find that instance....

hope that helps... let me know how it works out!

cheers,

mark

Consulting | Design | Motion | Training>headTrix, Inc. | Adobe Certified Training & Consulting<br />Consulting | Design | Development | Training

Votes

Translate

Translate

Report

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 20, 2017 Nov 20, 2017

Copy link to clipboard

Copied

Mark

Thanks. The code is in the topmost frame.

All button instances are on the same frame and named properly.

It is quite frustrating because it works some times, however when I reopen the animation to fine tune something unrelated to buttons - I notice it does not work.

It seems like a glitch in the Animate itself.

thanks again

Usha

Votes

Translate

Translate

Report

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 Expert ,
Nov 20, 2017 Nov 20, 2017

Copy link to clipboard

Copied

you can share the file and I can take a look at it you would like.

Consulting | Design | Motion | Training>headTrix, Inc. | Adobe Certified Training & Consulting<br />Consulting | Design | Development | Training

Votes

Translate

Translate

Report

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 21, 2017 Nov 21, 2017

Copy link to clipboard

Copied

I would share the file ,except I do not know where to load it or send.

Usha

Votes

Translate

Translate

Report

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 Expert ,
Nov 20, 2017 Nov 20, 2017

Copy link to clipboard

Copied

Make sure the buttons are availabe throughout the entire timeline or that you don't have keyframes duplicating your buttons or something like this.

And is there any other code running from inside some Movie Clip?

Anyway, if is not a problem, upload a picture of your timeline and code or upload the FLA itself.

Votes

Translate

Translate

Report

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 Expert ,
Nov 21, 2017 Nov 21, 2017

Copy link to clipboard

Copied

send it to mark@headtrix.com (might want to zip it first)

Consulting | Design | Motion | Training>headTrix, Inc. | Adobe Certified Training & Consulting<br />Consulting | Design | Development | Training

Votes

Translate

Translate

Report

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 Expert ,
Nov 22, 2017 Nov 22, 2017

Copy link to clipboard

Copied

LATEST

Hi Usha!

I took a look at your file...very complicated.... first off... its a good idea to ALWAYS use different instance names for your buttons.... and different label names for your labels. Im actually surprised you do not have more errors.

This is a very simple fix.... if you look at your file you will see the your A label is the ONLY label that ALSO has a STOP ACTION ON IT....

so when in b or c... and you click A... a says go to and PLAY a... but on a is a STOP action....

so I just moved the A label in the MC named "5 extrinsic pathway_birdseye" over to frame 2.... and seems to work fine

let me know if that helps!

cheers,

mark

Consulting | Design | Motion | Training>headTrix, Inc. | Adobe Certified Training & Consulting<br />Consulting | Design | Development | Training

Votes

Translate

Translate

Report

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