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

1120: Access of undefined properties button2

Community Beginner ,
Dec 05, 2018 Dec 05, 2018

Copy link to clipboard

Copied

Hello,

I'm hoping for some insight into an issue I am having. I am trying to create a series of buttons, one that sends you to another frame, that has a new button, which then sends you to a third frame. When I say buttons, in reality I am just using AS3 event handlers on movie clip symbols, so they act like buttons.

When I just have a handler for the first button with the code, and run the file, it works without fail.

button1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_2);

function fl_ClickToGoToAndPlayFromFrame_2(event:MouseEvent):void

{

gotoAndPlay(62);

}

But if I add a second movie Clip with a different instance name, and add the action

button2.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_3);

function fl_ClickToGoToAndPlayFromFrame_3(event:MouseEvent):void

{

gotoAndPlay(82);

}

I get the error on runtime "1120: Access of undefined properties button2".

I'm not sure when when I effectively duplicate the frames, change the instance name and function name, this does not run. Any insight would be wonderful.

Thank you!

Views

21.4K

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 , Dec 06, 2018 Dec 06, 2018

disable advanced layers (or learn how their use changes the code you need to use), modify>document>untick 'advanced layers'

Votes

Translate

Translate
Community Expert ,
Dec 06, 2018 Dec 06, 2018

Copy link to clipboard

Copied

disable advanced layers (or learn how their use changes the code you need to use), modify>document>untick 'advanced layers'

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 ,
Dec 06, 2018 Dec 06, 2018

Copy link to clipboard

Copied

Thank you! As someone who is very new to Animate and just learning using lynda videos I would have never known to have done that. It seems to have been the fix I am looking for. Now, to read up on it

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 ,
Dec 06, 2018 Dec 06, 2018

Copy link to clipboard

Copied

you're welcome.  and here's info about advanced layer, Create timeline layers with Animate CC

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
New Here ,
Oct 06, 2020 Oct 06, 2020

Copy link to clipboard

Copied

Turning off advanced layers works to solve this problem for me, but then animations involving the camera are removed, does anyone know a way to fix the "1120: Access of undefined properties" problem, whilst still being able to use a camera layer?

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 ,
Aug 26, 2021 Aug 26, 2021

Copy link to clipboard

Copied

i think this has been fixed and there's now no longer a need to reference the layer in either html5/canvas or as3 documents.  ie, your 1120 error is a user error, and not because of any special needs caused by using smart layers/virtual camera

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
Participant ,
Apr 10, 2023 Apr 10, 2023

Copy link to clipboard

Copied

Are you saying that now, after a fix, smart layers are not the cause of the 1120 error, (though disabling it removes the error). Is there an explanation of what causes a 1120 error when smart layers are enabled?

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 ,
Apr 10, 2023 Apr 10, 2023

Copy link to clipboard

Copied

maybe your animate version 

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
Participant ,
Apr 11, 2023 Apr 11, 2023

Copy link to clipboard

Copied

I am on the most current CC version of Animate, (23.0.1). We you pointing out that there is a way to keep smart layers enabled, and have more than one AS3 button? While subsequent buttons work when smart layers are disabled, there are frequent warnings about it being disabled. Is there a better way to define multiple AS3 buttons than with the function call examples that christophern6788262 listed, which are also provided in the Code snippets interface?

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
Participant ,
Apr 11, 2023 Apr 11, 2023

Copy link to clipboard

Copied

The link you provided at the top, advanced layers, does give an example of how to implement buttons with advanced layers. It shows an example for a movie clip, rather than a button though, Would Button would replace each instance of MovieClip:

Var Layer:MovieClip =MovieClip(getchildbyname("L1"));
Layer.getchildbyname("symbol1");

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 ,
Apr 11, 2023 Apr 11, 2023

Copy link to clipboard

Copied

LATEST

buttons, movieclips, graphics - it doesn't matter as long as it's a symbol that can be assigned an instance name.

 

and using advanced layers in animate v23.0.1 doesn't require a special reference when i test.

 

tick permit debugging in your publish settings and test with advanced layers enabled. what's the full error message?

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
New Here ,
Nov 28, 2021 Nov 28, 2021

Copy link to clipboard

Copied

heaven sent. been tinkering and wondering what's wrong for hours. who knows it was just as simple as this!

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
New Here ,
Jun 06, 2022 Jun 06, 2022

Copy link to clipboard

Copied

Thank you so much for this 🤩🤩🤩 now im able to make my game project at school. This was the only problem that's stopping me from doing it soo.... thank u very much 😁😁😁

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 ,
Jun 06, 2022 Jun 06, 2022

Copy link to clipboard

Copied

you're welcome.

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 ,
Dec 06, 2018 Dec 06, 2018

Copy link to clipboard

Copied

Check out this tutorial on buttons.

see if this helps.

Actions on buttons in Adobe Animate - YouTube

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 ,
Dec 06, 2018 Dec 06, 2018

Copy link to clipboard

Copied

Thanks! I definitely will check that video out

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
LEGEND ,
Dec 06, 2018 Dec 06, 2018

Copy link to clipboard

Copied

Every time I see a thread like this, I can't help but think that Adobe profoundly screwed up their implementation of advanced layers if simply turning them on breaks even the simplest code. Just moving a symbol from one layer to another can break a functioning script as well. There had to have been a better way to implement this.

The fact that the 2019 update now enables advanced layers by default is the cherry on top of the disaster sundae. It's like Adobe is trying to stop people from using the last decade or so of example AS3 code.

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
LEGEND ,
Dec 06, 2018 Dec 06, 2018

Copy link to clipboard

Copied

I concur! I was thinking the same thing.

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
Engaged ,
Dec 06, 2018 Dec 06, 2018

Copy link to clipboard

Copied

I concur with resdesign concurring with Clay. A bit of a mess. Have it turned off by default at the very least.

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 ,
Dec 06, 2018 Dec 06, 2018

Copy link to clipboard

Copied

lol.  i can't even get a movieclip to play when it's added to the main timeline when 'advanced layers' is enabled unless main timeline frames are added (like graphics require).

and the code to reference an object (mc_child) in a movieclip (mc) is a bit over-the-top:

MovieClip(MovieClip(getChildByName('layer containing mc)).mc.getChildByName('layer containing mc_child')).mc_child

and to think this used to be, mc.mc_child

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
Explorer ,
Feb 09, 2019 Feb 09, 2019

Copy link to clipboard

Copied

This 2019 update has caused me BOAT LOADS of stress and confusion.  The way I've created presentations at work for the past 5 years suddenly stopped working.  I wasted so much time at work this week trying to figure out why my simple goto and stop actions were creating errors.

TURN OFF ADVANCED LAYERS BY DEFAULT ADOBE!

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 ,
Feb 09, 2019 Feb 09, 2019

Copy link to clipboard

Copied

adobe allows you to do just that.

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