User Guide
234 Chapter 2: ActionScript Language Reference
Then open a new FLA file in the same directory and select Frame 1 of the Timeline. Enter the
following code into the Actions panel:
var my_xml:XML = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success:Boolean) {
trace(success);
CustomActions.install("dogclass", this.firstChild);
trace(CustomActions.list());
};
my_xml.load("dogclass.xml");
Select Control > Test Movie, and if the XML loads successfully, you will see true, and an array
containing the names of all the custom actions that are registered with the Flash authoring tool in
the Output panel. Close the SWF file, and open the Actions panel. You will see a new item in the
Actions toolbox called Dog, and inside that folder you see getFleas.