Instructions for Saving a Package File
To properly save a class, it is important to duplicate the package hierachy in folders on your computer. Using an example from Flash intrinsic classes, class Point in package flash.geom
package flash.geom {
public class Point
requires this folder structure:
|- flash (folder)
|- geom (folder)
|- Point.as (file)
where geom is a folder inside flash, and flash is inside a folder designated for shared classes or inside the folder associated with the current project. The name of the package file is the name of the class plus ".as".
If you want to save to a folder associated with the current project, before creating the package file, use File > Save As to establish the project folder. Also, the folder structure needs to be created before saving the package file or else an error message will say that the folder can't be found.
Root paths for shared classes are defined in File > Action Script Classes > Root Paths for Classes.
Action Script Editor
KoolMoves provides Flash 6/7/8 (AS1) and Flash 9 (AS3) action scripting capability. A large fraction of the possible Flash 5/6/7/8/9 operators and commands are supported at this time. It is important to note that Flash 8 and Flash 9 are case sensitive.
Some Flash 4 syntax is not supported. The only valid target syntax is the dot syntax. For example, Flash 4 syntax _level0:clip and _level0/clip should be represented as _level0.clip.
Note that if you use gotoAndPlay or gotoAndStop actions and if you use a KoolMoves' preloader, 2 frames are automatically added by KoolMoves at the beginning of the movie.
Also note that in gotoAndPlay, the first frame of the movie is 1 not 0. It is less error prone to name frames and use frame names in goto actions rather than frame numbers.
Interface components can be added to the canvas through the Tools toolbar or through action script. Instructions and examples on how to implement KoolMoves components in action script can be found at Program Files\KoolMoves\Examples\Components. www.koolmoves.com/support.html and www.koolexchange.com are also good resources.
Details on AS3 components can be viewed by pressing the second icon from the left (man/question mark) which is linked to Program Files\KoolMoves\Bin\AS3\Documentation\km\index.html.
For AS1 components, use attachMovie to add the component from the component symbol library to the canvas using action script. An excellent example of how to do this is shown in the action script in Program Files\KoolMoves\Examples\Components\Flash 8\Examples\KC8 Demo.fun. The syntax is different from Adobe Flash components. For example, to set Flash 8 component combobox or listbox items, this code is used:
myTF = new TextFormat();
myTF.font = 'Arial';
myTF.size = 12;
items = new Array();
items.push({label:'line 1', value:1});
items.push({label:'line 2', value:2});
items.push({label:'line 3', value:3, selected:true});
items.push({label:'line 4', value:4});
items.push({label:'line 5', value:5});
myListbox.setItems(items, false, myTF);
Most of AS3 is supported. Using a comma to end a statement isn't supported. Use a semi-colon. E4X isn't supported yet. Nested named functions are not supported, but a literal function inside a named function is supported. Flex/Flash CS4 Embed statements are supported. Private helper classes will be supported soon.
It is helpful to use the debugger version of the Flash player which can be downloaded at www.adobe.com/support/flashplayer/downloads.html. You can use FireFox in combination with two FireFox plugins Flash Tracer and Flash Switcher to help debug code. Flash Tracer can output trace to a panel inside FireFox on the left of the website that is shown if the debug version of the Player is installed. Flash Switcher allows switching different versions of the Flash Player very easily so you can quickly switch between testing FP8, FP9, FP10 both the normal and debug versions.