Multiple Actionscript 3 layers

霸气de小男生 提交于 2019-12-11 02:24:58

问题


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:


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

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.

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

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



来源:https://stackoverflow.com/questions/11445563/multiple-actionscript-3-layers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!