• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Storing Scripts

Often, I’m sad to say, when I think to use an old script, I usually hunt it down in an old project’s source file. This works fine, but it’s not exactly ideal. There are many ways to store your favorite scripts so that they’re available to you when you need them. This section shows you how to include external ActionScript (AS; extension .as) text when you publish your movie and how to grab your own homemade code snippets from the Behaviors panel.

AS Text Files

Flash supports a feature called #include, which enables you to store your scripts in an external text file. The way it works is that in lieu of writing scripts right inside the Actions panel, you can instead point to an external file. For example, I can put the following script in the first frame of my movie:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint