Highlighted

Noob questions

Community Beginner ,
Mar 15, 2019

Copy link to clipboard

Copied

I used  AS2 in a basic way for many years and I was able to do everything I needed. Now I've started using animate and I'm struggling with things that used to be easy and also finding solutions to them.

One that's bugging me now is referencing movieclips or buttons that are not present constantly on my timeline.

If I have buttonA on frame 1 and buttonB on frame 2, I assumed that I could put my actionscript for buttonA on frame 1 and for buttonB on frame 2 but this gives errors straight away as "access of undefined property buttonB and buttonA as they are not present throughout the timeline.

How do I resolve this? There must be a way of adding actionscript to elements that are not present on every single frame of the timeline.

TOPICS
ActionScript

Views

196

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

Noob questions

Community Beginner ,
Mar 15, 2019

Copy link to clipboard

Copied

I used  AS2 in a basic way for many years and I was able to do everything I needed. Now I've started using animate and I'm struggling with things that used to be easy and also finding solutions to them.

One that's bugging me now is referencing movieclips or buttons that are not present constantly on my timeline.

If I have buttonA on frame 1 and buttonB on frame 2, I assumed that I could put my actionscript for buttonA on frame 1 and for buttonB on frame 2 but this gives errors straight away as "access of undefined property buttonB and buttonA as they are not present throughout the timeline.

How do I resolve this? There must be a way of adding actionscript to elements that are not present on every single frame of the timeline.

TOPICS
ActionScript

Views

197

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
Mar 15, 2019 0
Community Beginner ,
Mar 15, 2019

Copy link to clipboard

Copied

I found a solution but it feels like I'm doing this wrong. Basically, if I have all my movieclips/buttons present throughout but with their visibility set to off it works. There must be a better way!

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...
Mar 15, 2019 0
LEGEND ,
Mar 15, 2019

Copy link to clipboard

Copied

When you get the error are the buttons on different layers or in adjacent frames?  You definitely shouldn't be getting an error if you are stopped in 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...
Mar 15, 2019 0
Community Beginner ,
Mar 15, 2019

Copy link to clipboard

Copied

same layer adjacent frames

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

Copy link to clipboard

Copied

Hi.

Turn off the advanced layers mode (Ctrl/Cmd + J) and things will probably work the way you expect.

Regards,

JC

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

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...
Mar 15, 2019 0