Skip to main content
manuelb19820178
Known Participant
March 15, 2019
Question

Noob questions

  • March 15, 2019
  • 2 replies
  • 385 views

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.

This topic has been closed for replies.

2 replies

JoãoCésar17023019
Community Expert
Community Expert
March 15, 2019

Hi.

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

Regards,

JC

manuelb19820178
Known Participant
March 15, 2019

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!

Ned Murphy
Legend
March 15, 2019

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.

manuelb19820178
Known Participant
March 15, 2019

same layer adjacent frames