This content has been marked as final. Show 4 replies
you should try and keep as much code as practicable attached to one frame of one timeline. but there are many occasions when it's not wise to attach all the coding to one frame of one timeline.
a major problem for inexperienced users is that attaching code to one frame of one timeline requires an understanding of paths to reference objects on other timelines and that understanding is not something that is easy for everyone.
coding for an external swf is usually best kept in the external swf. part of the reason for using an external swf is to break a larger project into a collection of smaller projects to make it easier to create.
coding within any one swf is best kept to one frame of one timeline but as mentioned above, that's not always true and almost always requires familiarity with paths.
excellent, thank you, kglad.
i will try to re-organize on a copy and see what happens.
one follow up- is it "proper" to use muliple layers for AS?
in other words, if i have some code that should be accesible over the entire length of the timeline, but for some reason i need to
put one piece of code in a particular keyframe along the way, should i make one actions layer that spans the whole movie, and another with keyframes for specific pieces of code? (it seems to me that this could further organize "types" of code...)
using one layer for actionscript is a good idea. if you have hundreds of lines of code you may even want to use more than one layer for your actionscript.
i think, in general, it's a good idea to use many layers. you'll find your projects are much easier to control if you place each object (in the authoring environment) in its own layer. layers can be collapsed into folders for even better organization if you find yourself creating many layers.
doing this is especially helpful if more than one person will need to work on a project or you return to a project after a number of months.
i agree with Kglad. But if you plan to do a lot of actionscript in the futur keep in mind that the next step is the use of Classes. There is no better way to organize codes. And the OOP aspect of Classes will give you much more than that.
There's a lot of programers out there that suggest to use classes only on big project with lot of actionScript. I dont agree; even on really small project i always use classes but hey, everyone has their own style .. thats the beauty of programation.