2
votes

I'm wondering if I split up certain bits of code that are meant for different sections into different layers will they have functionality between them or act as separate things. (will I be able to reference a variable on one layer from the other?)

Basically I have a set of code that runs throughout every frame but also need code specific to certain frames but still be able to access the main code.

Thanks

1

1 Answers

5
votes

You could have code that spans multiple frames as well as individual frame script:

timeline

In this case, individual key frame script from actions layer could call functions defined in main actions, likewise main actions can call functions from code within the current frame of actions layer.

As applications increase in complexity, you may want to consider using classes over frame script, defining a base document class for your project.

document class

As well, define classes per symbols in the library through AS Linkage:

library

There are many design patterns for larger applications to reduce complexity.