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.
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!
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.
Copy link to clipboard
Copied
same layer adjacent frames
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