Externalize Actionscript

[ LiB ] 

Let's say you have several lengthy scripts that you use in multiple Flash documents. Updating them can be a hassle because you have to open each file, locate the script, and make the changes. Here's a way you can actually keep all your nifty scripts in their own documents and never actually place them in Flash. Doing this will let you create your own library of scripts, share them as you like, and make changes to one location when necessary. To do that, either copy and paste an existing script or write a new one into a text file and save it with a .as extension. You can now put the following line of code on a keyframe in your document.

 #include "yourfilenamehere.as" 

Flash will automatically load the script from your file each time it's published, tested, or exported. And guess whatyou can also edit .as files with your favorite text editor or Dreamweaver MX 2004, which will provide AS syntax highlighting and code hints.

[ LiB ] 

Macromedia Flash MX 2004 Killer Tips
Macromedia Flash MX 2004 Killer Tips
ISBN: 0735713839
EAN: 2147483647
Year: 2003
Pages: 300
Authors: Shane Elliott

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net