views:

39

answers:

3

I am using Adobe Flash CS3 with Actionscript 3.0. What are the different ways to add scripts to a project except adding the script to a new keyframe?

+1  A: 

You can use a document class, which lets your scripts reside exclusively in files (instead of on the frame).

This is the only other method that I am aware of for linking code to a project in the Flash authoring tool.

UPDATE: As others have mentioned, you can also specify a class to link your library assets to (I had forgotten about this :-). This lets you add custom behaviour when creating instances of your assets; for example, you can link a MovieClip asset to a class that extends MovieClip. Then, whenever you instantiate instances of that asset in your code, they will have all the behaviour of the linked class.

Cameron
+1  A: 

Specifying a document class, as Cameron suggest, is a good starting point. That class (the main class, if you will) can then import and use other classes.

You can also specify classes for library items (Properties/Linking/Export for ActionScript).

Lars