beautypg.com

Adobe Flash Professional CC 2014 v.13.0 User Manual

Page 685

background image

To the top

To the top

To the top

To check syntax, do one of the following:

In the Actions panel or Script window, click Check Syntax

.

Click in the Script pane, and then press Control+T (Windows) or Command+T (Macintosh). Clicking or typing in the Script pane gives it the
focus. If an object on the Stage has the focus, the Transform panel opens instead.

Syntax errors are listed in the Compiler Errors panel.

Note: In an external ActionScript class file in the Script window, the global classpath (AS2) or source path (AS3) affects the syntax check. Even if
the global classpath or source path is set correctly, you might generate errors, because the compiler is not aware that this class is being compiled.

Check for punctuation balance

1. Click between braces {}, brackets [], or parentheses () in your script.

2. In Windows, press Control+' (single quote); on the Macintosh, press Command+' (single quote). The text between braces, brackets, or

parentheses is highlighted, and you can check that opening punctuation has corresponding closing punctuation.

(Deprecated with Flash Professional CC) Import and export scripts

You can import a script into the Actions panel or Script window. You can also export your scripts from the Actions panel to external ActionScript
files. (When you use the Script window, exporting is unnecessary because you can instead save the AS file.)

If text in your scripts doesn’t look as expected when you open or import a file, change the import encoding preference.

Import an external AS file

1. In the Script pane, place the insertion point where you want to locate the first line of the external script.

2. Do one of the following:

In the Actions panel, select Import Script from the panel menu, or press Control+Shift+I (Windows) or Command+Shift+I (Macintosh).

In the Script window, select File > Import Script or press Control+Shift+I (Windows) or Command+Shift+I (Macintosh).

Export a script from the Actions panel

1. Select the script to export. Then select Export Script from the Actions Panel menu, or press Control+Shift+X (Windows) or

Command+Shift+X (Macintosh).

2. Save the ActionScript (AS) file.

Set text encoding options

1. Select Edit > Preferences (Windows) or Flash > Preferences (Macintosh), and select ActionScript in the Category list.

2. Set any of these options:

Open/Import Select UTF-8 Encoding to open or import using Unicode encoding, or select Default Encoding to open or import using the
encoding form of the language currently used by your system.

Save/Export Select UTF-8 Encoding to save or export using Unicode encoding, or select Default Encoding to save or export using the
encoding form of the language currently used by your system.

Turn the export encoding warning off or on

1. Select Edit > Preferences (Windows) or Flash > Preferences (Macintosh), and select Warnings in the Category list.

2. Select or deselect Warn On Encoding Conflicts When Exporting ActionScript Files.

(Deprecated with Flash Professional CC) Encoding for imported and exported scripts

You can set ActionScript preferences to specify the type of encoding to use in imported or exported ActionScript files. UTF-8 Encoding is 8-bit
Unicode format, which lets you include text in multiple languages in your file; Default Encoding is the encoding supported by the language your
system is currently using, also called the traditional code page.

Important: When you use a non-English application on an English system, the Test Movie command fails if any part of the SWF file path has
characters that cannot be represented by using the Multibyte Character Sets (MBCS) encoding scheme. For example, Japanese paths, which work
on a Japanese system, won’t work on an English system. Be sure to use English-only path names on English systems. All areas of the application
that use the Test Movie player are subject to this limitation.

(Deprecated with Flash Professional CC) Pin scripts in the Actions panel

If you don’t organize the code within your FLA file into one central location, or if you’re using behaviors, you can pin individual scripts in the Actions
panel to move among them more easily. To pin a script means that you can keep the location of the code open in the Actions panel, and easily
click between open scripts. This can be especially useful when debugging.

678