Skip to main content
Participant
Dec 6, 2018 5:38 AM UTC
Answered

1120: Access of undefined properties button2

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!

This topic is closed to new replies. Start a new post to keep the conversation going.
kglad
kgladCorrect answer
Community Expert
Dec 6, 2018 2:36 PM UTC

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

21 replies

Legend
Dec 6, 2018 6:55 PM UTC

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.

Translate
avid_body16B8
Legend
Dec 6, 2018 6:58 PM UTC

I concur! I was thinking the same thing.

Translate
Inspiring
Dec 6, 2018 8:15 PM UTC

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

Translate
Community Expert
Dec 6, 2018 2:50 PM UTC

Check out this tutorial on buttons.

see if this helps.

Actions on buttons in Adobe Animate - YouTube

Translate
Participant
Dec 6, 2018 3:56 PM UTC

Thanks! I definitely will check that video out

Translate
kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
Dec 6, 2018 2:36 PM UTC

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

Translate
Participant
Dec 6, 2018 3:56 PM UTC

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

Translate
kglad
Community Expert
Community Expert
Dec 6, 2018 3:59 PM UTC

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

Translate