|
Free Open Book
Macromedia Flash 8 Bible |
Writing ActionScript with DreamweaverWhen creating large Flash movies, many programmers choose to keep their ActionScript in external text files — typically saved with the .as file extension. There are many benefits to this method:
Since Dreamweaver MX, the Dreamweaver coding environment has supported external ActionScript files with full syntax coloring and code hinting features. This makes the process of creating code files much less error-prone than it was in early versions of Dreamweaver, where most methods of editing external ActionScript didn't offer any means of syntax checking. Code hinting in Dreamweaver creates pop-up menus that automatically appear when you're typing the name of an object, as is true in the ActionScript panel in Flash. For example, if your object name ends in _mc, the code hint menu will show the methods and properties for a movieClip object. If your object name ends in xmlsocket, you see the methods and properties for an XMLSocket object.
To create an ActionScript .as file in Dreamweaver 8, follow these steps:
Some ActionScript is well-suited to being written in external files — long routines, groups of functions, and object definitions, for example.
Though it may seem counterintuitive, it's practical to have more — rather than fewer — external files when writing code. A common method is to use a separate .as file for each object definition within your Flash project. In the Flash authoring environment, use the #include command in your Flash movie to load the code from an external file. External ActionScript is only included in the Flash movie when the .swf is published, so it will not be added to your .fla file. If you change any code in the external file, you'll need to publish the .swf again to include the changed ActionScript.
Dreamweaver also has support for creating a wide range of other code format files, including ActionScript Communication files (.asc) and ActionScript Remote files (.asr). These are used with advanced ActionScripting features.
|
Main Menu |
| 500 Juegos Gratis | 500 Giochi Gratis | 500 Jeux Gratuits | 500 Jogos Gratis | 500 Kostenlose Spiele |