List a SWF file’s objects and variables

To list a SWF file’s objects, use the List Objects command, which is useful for finding the correct target path and instance names. To list a SWF file’s variables, use the List Variables command, with which you can find a variable’s name and target path.

Selecting the List Objects or List Variables command clears the contents of the Output panel. If you do not want to lose this information, select Save to File from the Output Panel menu before selecting the command.

List a SWF file’s objects

In the test environment, the List Objects command shows the level, frame, object type (shape, movie clip, or button), target paths, and instance names of movie clips, buttons, and text fields in a hierarchical list in the Output panel. (It does not show all ActionScript data objects.)

  1. If your SWF file is not running in the test environment, select Control > Test Movie.
  2. Select Debug > List Objects.

    A list of all the objects currently on the Stage appears in the Output panel. The list does not update automatically as the SWF file plays; you must select the List Objects command each time you want to send the information to the Output panel.

List a SWF file’s variables in the Output panel

In the test environment, the List Variables command shows a list of all the variables in the SWF file. Global variables (those declared with the _global identifier) appear at the top of the List Variables output in a Global Variables section, and each variable has a _global prefix.

In addition, the List Variables command shows getter/setter properties—properties that are created with the Object.addProperty() method and start get or set methods. In the Output panel, the value of a getter/setter property is prefixed with [getter/setter]. The software determines the value that appears for a getter/setter property by evaluating the get function.

The list does not update automatically as the SWF file plays; you must select the List Variables command each time you want to send the information to the Output panel.

  1. Create a new FLA document. For example, you might call it listvariables.fla .
  2. Add the following ActionScript 2.0 in the Actions panel:
    	_global.myName = "Buster";
    	var myCatSays:String = "meow";
    	var myNum:Number = 313;
    	var myArray:Array = ["one", "two", "three"];
  3. Select Control > Test Movie.
  4. Select Debug > List Variables in the test environment.

    A list of all the variables currently in the SWF file appears in the Output panel. The following example shows the variables that would be output from the code listed above in step 2:

    	Global Variables:
    		Variable _global.myName = "Buster"
    	Level #0:
    	Variable _level0.$version = "WIN 9,0,29,3"
    	Variable _level0.myCatSays = "meow"
    	Variable _level0.myNum = 313
    	Variable _level0.myArray = [object #1, class 'Array'] [			0:"one",
    			1:"two",
    			2:"three"
    		]

  This page on the Web