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
is your button existing on all frames?
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:
var headerLayer:MovieClip = getChildByName("Header") as MovieClip;
// Alternatively: Header.btn_01.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_10);
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.
Thanks man, I solved the same problem after using your way provided. Thank you so much!
Excellent! You're welcome!
Thank you so much !!
you helped me through a school project were I had the issue of the buttons overlapping and this error.
Hi, I used this code and came out this
TypeError: Error #1009: Cannot access a property or method of a null object reference.
May I know how can I fix it?
In recent versions of Animate it's possible to access instances directly without worrying about advanced layers. Or are you trying to do something else?
Please let us know.