[Flex]Flex SDK 4(Gumbo)浅析ASDoc - ASDoc MXML应用篇

详细请看:http://s.k-zone.cn/asdoc3

上一篇文章,介绍了如何在AS文件里面写ASDoc文档。
本篇文章介绍在MXML中编写ASDoc文档。

单行注释:
<!--- asdoc comment -->

多行注释:
<!--- 
    /** 
     * Comment for my class 
     * which is implemented as mxml 
     */ 
--> 
<!--- 
    * Comment for my class 
    * which is implemented as mxml 
-->

例如:(例子摘自http://s.k-zone.cn/asdocmxml

<?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/halo" 
    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>

同样在mxml里面的<fx:Script></fx:Script>里面也可以使用ASDoc Tags
    <fx:Script>
        <![CDATA[
            import flash.events.MouseEvent;
            /** 
             * For a method in an &lt;Script&gt; block,
             * same rules as in an AS file.
             *
             * @param eventObj The event object.
             */
            public function handleClickEvent(eventObj:MouseEvent):void {
                dispatchEvent(eventObj);
            }   
            /** 
             * For a property in an &lt;Script&gt; block,
             * same rules as in an AS file.
             */
            public var myString:String = new String();
        ]]>
    </fx:Script>

<fx:Declaration>

例如:
<fx:Declarations> 
    <!--- 
        Specifies the skin for the first button on the ButtonBar. 
        @default spark.skins.default.ButtonBarFirstButtonSkin 
    --> 
    <fx:Component id="firstButton"> 
        <s:ButtonBarButton skinClass="spark.skins.default.ButtonBarFirstButtonSkin" /> 
    </fx:Component> 
</fx:Declarations>

<fx:Metadata>

例如:
<fx:Metadata> 
<![CDATA[ 
/** 
* Defines the default style of selected text. 
*/ 
[Style(name="textSelectedColor",type="Number",format="Color",inherit="yes")] 
]]>
</fx:Metadata>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值