26
Chapter 2: ActionScript Basics
Unicode support for ActionScript
Macromedia Flash MX 2004 and Macromedia Flash MX Professional 2004 support Unicode text
encoding for ActionScript. This means that you can include text in different languages in an
ActionScript file. For example, you could include text in English, Japanese, and French in the
same file.
You can set ActionScript preferences to specify the type of encoding to use when importing or
exporting ActionScript files. You can select either UTF-8 encoding or Default Encoding. UTF-8
is 8-bit Unicode format; Default Encoding is the encoding form supported by the language your
system is currently using, also called the
traditional code page
.
In general, if you are importing or exporting ActionScript files in UTF-8 format, use the UTF-8
preference. If you are importing or exporting files in the traditional code page in use on your
system, use the Default Encoding preference.
If text in your scripts doesn’t look as expected when you open or import a file, change the import
encoding preference. If you receive a warning message when exporting ActionScript files, you can
change the export encoding preference or turn this warning off in ActionScript preferences.
To select text encoding options for importing or exporting ActionScript files:
1
In the Preferences dialog box (Edit > Preferences), click the ActionScript tab.
2
Under Editing Options, do one or both of the following:
■
For Open/Import, select UTF-8 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.
■
For Save/Export, select UTF-8 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.
To turn the export encoding warning off or on:
1
In the Preferences dialog box (Edit > Preferences), click the Warnings tab.
2
Select or deselect Warn on Encoding Conflicts When Exporting .as Files.
Caution:
The Test Movie command (see
“Debugging your scripts” on page 68
) will fail if any part of
the SWF file path has characters that cannot be represented using the MBCS encoding scheme. For
example, Japanese paths on an English system will not work. All areas of the application that use the
external player are subject to this limitation.
Terminology
As with any scripting language, ActionScript uses its own terminology. The following list provides
an introduction to important ActionScript terms.
Actions
are statements that instruct a SWF file to do something while it is playing. For example,
gotoAndStop()
sends the playhead to a specific frame or label. In this manual, the terms
action
and
statement
are interchangeable.
Boolean
is a
true
or
false
value.
Classes
are data types that you can create to define a new type of object. To define a class,
you use the
class
keyword in an external script file (not in a script you are writing in the
Actions panel).
Summary of Contents for FLASH MX 2004 - ACTIONSCRIPT
Page 1: ...ActionScript Reference Guide...
Page 8: ...8 Contents...
Page 12: ......
Page 24: ...24 Chapter 1 What s New in Flash MX 2004 ActionScript...
Page 54: ...54 Chapter 2 ActionScript Basics...
Page 80: ...80 Chapter 3 Writing and Debugging Scripts...
Page 82: ......
Page 110: ...110 Chapter 5 Creating Interaction with ActionScript...
Page 112: ......
Page 120: ...120 Chapter 6 Using the Built In Classes...
Page 176: ......
Page 192: ...192 Chapter 10 Working with External Data...
Page 202: ...202 Chapter 11 Working with External Media...
Page 204: ......
Page 782: ...782 Chapter 12 ActionScript Dictionary...
Page 793: ...Other keys 793 221 222 Key Key code...
Page 794: ...794 Appendix C Keyboard Keys and Key Code Values...
Page 798: ...798 Appendix D Writing Scripts for Earlier Versions of Flash Player...
Page 806: ...806 Appendix E Object Oriented Programming with ActionScript 1...
Page 816: ...816 Index...