Highlighted

Help Needed with closing a menu

Community Beginner ,
Jan 15, 2019

Copy link to clipboard

Copied

Hey,

I hope you can help, I think its very simple but I am jsut starting.

1.PNG2.PNG

I want to close my menu. The picture(converted into movie clip) is in the layer "Button_an" on frame 10.

therefore I created an empty keyframe on frame 10 with the following code:

menu_close.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame);

function fl_ClickToGoToAndStopAtFrame(event:MouseEvent):void

{

    gotoAndStop(1);

}

I already checked the name - its correct

I already checked if the code is in the right frame action (its 10, thats correct)

3.PNG

however, there is an error saying, that my menu_close is not beingt defined (error: 1120:Access of undefined property error )

thanks for hleping out!

Adobe Community Professional
Correct answer by kglad | Adobe Community Professional

a better solution:

disable advanced layers (modify>document>untick 'use advanced layers').

info about advanced layers: https://helpx.adobe.com/animate/using/timeline-layers.html#advanced-layers

Views

283

Likes

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

Help Needed with closing a menu

Community Beginner ,
Jan 15, 2019

Copy link to clipboard

Copied

Hey,

I hope you can help, I think its very simple but I am jsut starting.

1.PNG2.PNG

I want to close my menu. The picture(converted into movie clip) is in the layer "Button_an" on frame 10.

therefore I created an empty keyframe on frame 10 with the following code:

menu_close.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame);

function fl_ClickToGoToAndStopAtFrame(event:MouseEvent):void

{

    gotoAndStop(1);

}

I already checked the name - its correct

I already checked if the code is in the right frame action (its 10, thats correct)

3.PNG

however, there is an error saying, that my menu_close is not beingt defined (error: 1120:Access of undefined property error )

thanks for hleping out!

Adobe Community Professional
Correct answer by kglad | Adobe Community Professional

a better solution:

disable advanced layers (modify>document>untick 'use advanced layers').

info about advanced layers: https://helpx.adobe.com/animate/using/timeline-layers.html#advanced-layers

Views

284

Likes

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
Jan 15, 2019 0
Adobe Community Professional ,
Jan 15, 2019

Copy link to clipboard

Copied

menu_close does not exist when the error message is triggered.

Likes

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
Reply
Loading...
Jan 15, 2019 0
Community Beginner ,
Jan 15, 2019

Copy link to clipboard

Copied

Hey, tahnks for replying.

As shown in the screenshot, it does exist - dunno why the error massage states that

Likes

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
Reply
Loading...
Jan 15, 2019 0
Adobe Community Professional ,
Jan 15, 2019

Copy link to clipboard

Copied

you didn't show that it exists when the error message is triggered.  you showed it exists at some point/time.

Likes

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
Reply
Loading...
Jan 15, 2019 0
Community Beginner ,
Jan 15, 2019

Copy link to clipboard

Copied

4.PNG

it exists but somehow still triggers. Any suggestions?

Likes

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
Reply
Loading...
Jan 15, 2019 0
Community Beginner ,
Jan 15, 2019

Copy link to clipboard

Copied

here is a better screenshot with the isntance name

4.PNG

Likes

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
Reply
Loading...
Jan 15, 2019 0
Adobe Community Professional ,
Jan 15, 2019

Copy link to clipboard

Copied

Sorry, I mean "exists at runtime", when the code executes. Normally, the code executes first, and then, the graphic elements. This is why, maybe, if you delay your function (using a timing event), the error is gone.

Marlon Ceballos.

Likes

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
Reply
Loading...
Jan 15, 2019 0
Adobe Community Professional ,
Jan 15, 2019

Copy link to clipboard

Copied

remove that tween (which changes your menu_close reference).

Likes

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
Reply
Loading...
Jan 15, 2019 0
Community Beginner ,
Jan 16, 2019

Copy link to clipboard

Copied

so what code do I include or? .. sorry I am a beginner 😕 cant quite understand

Likes

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
Reply
Loading...
Jan 16, 2019 0
Community Beginner ,
Jan 16, 2019

Copy link to clipboard

Copied

what exactly do u mean with removing the tween?

Likes

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
Reply
Loading...
Jan 16, 2019 0
Adobe Community Professional ,
Jan 16, 2019

Copy link to clipboard

Copied

right click the tween span > remove tween.

Likes

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
Reply
Loading...
Jan 16, 2019 0
Community Beginner ,
Jan 16, 2019

Copy link to clipboard

Copied

I dont created a "tween". I just made a picture into my timelane (Layer "Button an") and put 1 picutre over 10 frames in it (including the drop downmenu and the close button (arrow) and that arrow I converted into a movieclip and want to, by clicking, get back to frame 1

Likes

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
Reply
Loading...
Jan 16, 2019 0
Adobe Community Professional ,
Jan 16, 2019

Copy link to clipboard

Copied

why is your timeline, at that layer/frame span, blue?

Likes

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
Reply
Loading...
Jan 16, 2019 0
Community Beginner ,
Jan 16, 2019

Copy link to clipboard

Copied

bexause i clicked on it - meaning its the selected layer, which my movieclip "menu_close" is on

Likes

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
Reply
Loading...
Jan 16, 2019 0
Adobe Community Professional ,
Jan 16, 2019

Copy link to clipboard

Copied

upload your fla somewhere and post a link.

Likes

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
Reply
Loading...
Jan 16, 2019 0
Community Beginner ,
Jan 16, 2019

Copy link to clipboard

Copied

ok, thanks so much

https://ufile.io/s0y8a

Likes

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
Reply
Loading...
Jan 16, 2019 0
Adobe Community Professional ,
Jan 16, 2019

Copy link to clipboard

Copied

i can't determine what you've done setting up that file to cause all the problems you're going to have.

my suggestion is to start with a new fla and careful add items and code in steps, checking for errors frequently.

if you just want to resolve the current error, click the problematic frame in the timeline (to select all items)>right click over the stage items>click distribute to layers.  test.

Likes

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
Reply
Loading...
Jan 16, 2019 0
Community Beginner ,
Jan 16, 2019

Copy link to clipboard

Copied

I did it again very clean, still not working

somehow if I have the close button from frame 1to10 - it works, but I want the button only to appear when opening the mnu on frame 5 - any suggestions?

Likes

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
Reply
Loading...
Jan 16, 2019 0
Adobe Community Professional ,
Jan 16, 2019

Copy link to clipboard

Copied

again, if you just want to resolve the current error, click the problematic frame in the timeline (to select all items)>right click over the stage items>click distribute to layers.  test.

Likes

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
Reply
Loading...
Jan 16, 2019 0
Community Beginner ,
Jan 17, 2019

Copy link to clipboard

Copied

ok, oh mygod it worked thank you so much - can you explain why tho? I dont get it? cant there be 2 items in 1 layer in the same frame?

Likes

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
Reply
Loading...
Jan 17, 2019 0
Adobe Community Professional ,
Jan 17, 2019

Copy link to clipboard

Copied

a better solution:

disable advanced layers (modify>document>untick 'use advanced layers').

info about advanced layers: https://helpx.adobe.com/animate/using/timeline-layers.html#advanced-layers

Likes

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
Reply
Loading...
Jan 17, 2019 0
Adobe Community Professional ,
Jan 15, 2019

Copy link to clipboard

Copied

You need to be sure that the function run after menu_close exists. Maybe, this event can help you: www.w3schools.com/js/js_timing.asp

Marlon Ceballos.

Likes

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
Reply
Loading...
Jan 15, 2019 0
Community Beginner ,
Jan 15, 2019

Copy link to clipboard

Copied

I used this function on my first frame for another movieclip, it does work, it only works in the first frame tho ..

Likes

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
Reply
Loading...
Jan 15, 2019 0