`
WonLen
  • 浏览: 49100 次
  • 性别: Icon_minigender_1
  • 来自: 大连
社区版块
存档分类
最新评论

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

    博客分类:
  • Flex
阅读更多

详细请看: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>

分享到:
评论
4 楼 WonLen 2009-08-07  
momoko8443 写道
3我没用过,4的ASDoc里面bug不少。

1、html标记在asdoc view中正常显示,在生成doc时通不过validation
2、@see 在同一个类中 使用函数名不能引用到,必须使用全路径
3、@copy 无法被传递2次。如B拷贝了A的注释,C拷贝了B的注释,在ide下是好的,转doc时就会发生C显示注释有误。


呵呵,世界真小,编辑群的朋友
3 楼 momoko8443 2009-08-07  
3我没用过,4的ASDoc里面bug不少。

1、html标记在asdoc view中正常显示,在生成doc时通不过validation
2、@see 在同一个类中 使用函数名不能引用到,必须使用全路径
3、@copy 无法被传递2次。如B拷贝了A的注释,C拷贝了B的注释,在ide下是好的,转doc时就会发生C显示注释有误。

2 楼 WonLen 2009-08-06  
yantoba 写道
字好灰,看起来好累。。

是有些灰色哦,下次注意~~~
1 楼 yantoba 2009-08-06  
字好灰,看起来好累。。

相关推荐

Global site tag (gtag.js) - Google Analytics