flash function help
Out of context: Reply #8
- Started
- Last post
- 12 Responses
- mrbee28280
I wouldn’t say it was “best practice”. You do want to consolidate your code and not have scripting all over the place. Your scripting decisions should be weighed against the type of project you’re developing. If it’s a simple animation/banner type thing with a launch button, something scripted in all within Flash at a few various points in AS1 is just fine. Don’t let anyone tell you different.
If you are developing a large site or application with lots of interaction points you want to go with a nice OOP model and leverage AS2 and external class files. This keeps a few initialization lines of code up front in the fla and the majority of the code within .as files.
I usually don’t find a middle ground anymore. If I do anything that will require even the smallest amount of debugging or possible client changes I go AS2 and class files. It keeps me sharp and it’s easier to isolate problems. From what you have described I would simply add a function on the main timeline in frame 1 that does some action. Within the movieclip that acts as the button I would place an event to call the previous mentioned function. You could then keep all your code in the first frame of each “important” timline.