Skip to main content
Participant
January 26, 2019
Question

1120: Access of undefined property

  • January 26, 2019
  • 3 replies
  • 4950 views

Hello, All

I am trying To navigate from scene 3 to  scene 2 through button but i get

1120: Access of undefined property


and after i google all possible solutions and not fix the issue.

i came here to try to find any help to fix this issue.

you will find FLA file attached below

https://www.dropbox.com/s/s6bc60trazgqpxg/Untitled-8.fla?dl=0

Regards

3 replies

shawns96704139
Participating Frequently
March 9, 2023

So while the Advanced Layers situation may fix this, we're seeing instances where it's working on one project but not another.

If SOMEONE from Adobe could PLEASE watch this video and tell my while one project with the EXACT SAME CODE works FINE with Advanced Layer and anotherone with the EXACT SAME CODE does NOT work with Advanced Layers I would certainly appreciate it!!

Thank you!

Dominik270717731ubm
Participant
April 24, 2023

So true, got the same problem with my project and still the only fix is turning off advanced layers, which doesnt really help because i am using camera.

kglad
Community Expert
Community Expert
April 24, 2023

watching a video is unlikley to reveal the problem cause.

JoãoCésar17023019
Community Expert
Community Expert
January 26, 2019

Hi.

It's because the Advanced Layers mode is on.

- If you want to keep it on, you're gonna have to reference the layer that contains the button by its name first. Like this:

import flash.display.MovieClip;

import flash.events.MouseEvent;

var headerLayer:MovieClip = getChildByName("Header") as MovieClip;

stop();

headerLayer.btn_01.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_10);

// Alternatively: Header.btn_01.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_10);

function fl_ClickToGoToScene_10(event:MouseEvent):void

{

    MovieClip(this.root).gotoAndPlay(1, "Scene 1");

}

- If you don't want to use the Advanced Layers mode and reference objects in the old way, do this:

Go to the Document Settings (Ctrl/Cmd + J) and uncheck Use Advanced Layers.

Create timeline layers with Animate CC

Regards,

JC

Participant
May 16, 2021

Thanks man, I solved the same problem after using your way provided. Thank you so much!

JoãoCésar17023019
Community Expert
Community Expert
May 16, 2021

Excellent! You're welcome!

Robert Mc Dowell
Legend
January 26, 2019

is your button existing on all frames?

Participant
January 26, 2019

Yes