
36
Chapter 2: Using MXML
Naming MXML files
MXML filenames must adhere to the following naming conventions:
•
Filenames must be valid ActionScript identifiers, which means they must start with a letter or
underscore character (_), and they can only contain letters and numbers and underscore
characters after that.
•
Filenames must not be the same as ActionScript class names, component
id
values, or the
word
application
. Do not use filenames that match the names of MXML tags that are in the mx
namespace.
•
Filenames must end with a lowercase .mxml file extension.
Using tags that represent ActionScript classes
An MXML tag that corresponds to an ActionScript class uses the same naming conventions as the
ActionScript class. Class names begin with a capital letter, and capital letters separate the words in
class names. For example, when a tag corresponds to an ActionScript class, its properties
correspond to the properties and events of that class.
Setting component properties
In MXML, a component property uses the same naming conventions as the corresponding
ActionScript class. A property names begins with a lower case letter, and capital letters separate
words in the property names. You can set the values of properties using tag attributes or child tags.
Macromedia recommends that you assign scalar values and simple binding expressions as
attributes and that you assign complex types as child tags. Each of a component’s properties is one
of the following types:
•
Scalar properties, such as a number or string
•
Array of scalar values, such as an array of numbers or strings
•
ActionScript object
•
Array of ActionScript objects
•
ActionScript properties
•
XML data
•
Style properties
Scalar properties
You usually specify the value of a scalar property as a property of a component tag, as the
following example shows:
<Label width="50" height="25" text="Hello World"/>
Note:
A tag property cannot consist of the @ character followed by one or more characters.
Содержание FLEX-GETTING STARTED WITH FLEX
Страница 1: ...Getting Started with Flex...
Страница 4: ...4 Contents...
Страница 22: ...22 Chapter 1 Introducing Flex...