beautypg.com

Writing and managing scripts – Adobe Flash Professional CC 2014 v.13.0 User Manual

Page 682

background image

Writing and managing scripts

To the top

To the top

Format code
Comment sections of code
Use syntax coloring
Using the identifier and keyword list at runtime
Use line numbers and word wrap
Display hidden characters
Find text in a script
(Deprecated with Flash Professional CC) Check syntax and punctuation
(Deprecated with Flash Professional CC) Import and export scripts
(Deprecated with Flash Professional CC) Encoding for imported and exported scripts
(Deprecated with Flash Professional CC) Pin scripts in the Actions panel
Insert target paths
Use code hints

Format code

Your code can be formatted and indented automatically when typing. If you use dynamic font mapping, you ensure that the correct fonts are used
for multilingual text.

(Deprecated with Flash Professional CC) Set Auto Format options

1. Do one of the following:

From the panel menu

(at the upper-right corner of the Actions panel), select Preferences.

In the Script window, select Edit > Preferences (Windows) or Flash > Preferences (Macintosh).

2. In the Preferences dialog box, select Auto Format.

3. Select any of the Auto Format options.

After you set Auto Format options, your settings are applied automatically to the code you write, but not to existing code; you must apply
your settings to existing code manually.

(Deprecated with Flash Professional CC) Format code according to Auto Format settings

Click Auto Format

in the Actions panel or Script window toolbar.

From the panel menu (at the upper-right corner of the Actions panel), select Auto Format.

Press Control+Shift+F (Windows) or Command+Shift+F (Macintosh).

In the Script window, select Tools > Auto Format.

(Deprecated with Flash Professional CC) Use dynamic font mapping

To turn dynamic font mapping on or off, select or deselect Use Dynamic Font Mapping in the Preferences dialog box.

Dynamic font mapping is turned off by default because it increases performance time when you are scripting. If you are working with multilingual
text, turn on dynamic font mapping because it helps to ensure that the correct fonts are used.

Use automatic indentation

To turn automatic indentation on or off, select or deselect Automatic Indentation in the Preferences dialog box.

When automatic indentation is turned on, the text you type after an opening parenthesis “(“ or opening curly brace “{“ is automatically indented
according to the Tab Size setting in ActionScript preferences.

In your scripts, you can indent a line by selecting it and pressing Tab. To remove the indent, select the line and press Shift+Tab.

Comment sections of code

Code comments are parts of code that the ActionScript compiler ignores. A comment lines explains what your code is doing, or temporarily
deactivates code that you don’t want to delete. Comment a line of code by beginning it with a double slash (//). The compiler ignores all text on that
line after the double slash. You can also comment larger blocks of code by placing a slash and asterisk (/*) at the beginning of the block and an
asterisk and slash (*/) at the end of the block.

675