FLASH CS3
User Guide
393
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.
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 Shift+F (Windows) or Shift+F (Macintosh).
•
In the Script window, select Tools > Auto Format.
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.
You can type these comment markers manually, or you can use buttons at the top of the Actions panel or Script
window to add them.
Comment a line of code
1
Place the insertion point at the beginning of the line or at the character where you want the comment to begin.
2
Click Apply Line Comment
at the top of the Actions panel or Script window.
A double slash (//) is placed at the insertion point.
Comment multiple lines of code
1
Select the lines to comment. (The first and last lines of the selection can be partial lines.)
2
Click Apply Block Comment
at the top of the Actions panel or Script window.
Block comment characters are placed at the beginning (/*) and end (*/) of the selection.