Use the following syntax to specify an ASDoc comment in
an MXML file for an element defined in MXML:
<!--- asdoc comment -->
The comment must contain three dashes following the opening
<! characters, and
end with two dashes before the closing
> character,
as the following example shows:
<?xml version="1.0"?>
<!-- asdoc\MyVBox.mxml -->
<!---
The class level comment for the component.
This tag supports all ASDoc tags,
and does not require a CDATA block.
-->
<mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark">
<!---
Comment for button
-->
<s:Button id="myButton" label="This button has a comment"/>
</mx:VBox>
In this example, the first comment is a standard XML comment
ignored by ASDoc. The second comment precedes the root tag of the
component and uses the three dashes to identify it as an ASDoc comment.
An ASDoc comment on the root tag is equivalent to the ASDoc comment
before an ActionScript class definition. Therefore, the comment
appears at the top of the output ASDoc HTML file.
A leading dash at the beginning of each comment line, and any
whitespace characters before the dash, are ignored, as the following
example shows:
<!---
- Comment for my class
- which is implemented as mxml
-->
If you copy a comment from an ActionScript file that uses the
/**, *, and **/ characters, those characters are also ignored, as
the following example shows:
<!---
/**
* Comment for my class
* which is implemented as mxml
*/
-->
<!---
* Comment for my class
* which is implemented as mxml
-->
All MXML elements in the file correspond to public properties
of the component. The comment before the Button control defines
the ASDoc comment for the public property named myButton of type
mx.controls.Button.
You can use any ASDoc tags in these comments, including the @see, @copy, @param, @return,
and other ASDoc comments.
The ASDoc command-line tool only processes elements of an MXML
file that contain an
id attribute. If the MXML
element has an
id attribute but no comment, the
element appears in the ASDoc output with a blank comment. An MXML
element with no
id attribute is ignored, even if
it is preceded by an ASDoc comment, as the following example shows:
<?xml version="1.0"?>
<!-- asdoc\MyVBoxID.mxml -->
<!---
The class level comment for the component.
This tag supports all ASDoc tags,
and does not require a CDATA block.
@see mx.container.VBox
-->
<mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark">
<!---
Comment for first button appears in the output.
-->
<s:Button id="myButton" label="This button has a comment"/>
<s:Button id="myButton2"
label="Has id but no comment so appears in output"/>
<!---
Comment for button with no id is ignored by ASDoc.
-->
<s:Button label="This button has no id"/>
</mx:VBox>
Comments before Definition, Library, and Private tags are ignored.
Also comments inside a private block are ignored.