簡體   English   中英

記錄調度自定義事件(在動作腳本3中)

[英]Documenting dispatching custom events (in actionscript 3)

可以說我的X類能夠分派3種類型的(自定義)事件。 我應該在哪里以及如何最好地在類文件中記錄此行為?

在您的課程上方添加[Event]元標記。

Starling Framework中的示例:

package starling.core
{

    /** Dispatched when a new render context is created. */
    [Event(name="context3DCreate", type="starling.events.Event")]

    /** Dispatched when the root class has been created. */
    [Event(name="rootCreated", type="starling.events.Event")]

    /** The Starling class represents the core of the Starling framework.
     *
     *  <p>The Starling framework makes it possible to create 2D applications and games that make
     *  use of the Stage3D architecture introduced in Flash Player 11. It implements a display tree
     *  system that is very similar to that of conventional Flash, while leveraging modern GPUs
     *  to speed up rendering.</p>
     *  
     *  <p>The Starling class represents the link between the conventional Flash display tree and
     *  the Starling display tree. To create a Starling-powered application, you have to create
     *  an instance of the Starling class:</p>
     *  
     *  <pre>var starling:Starling = new Starling(Game, stage);</pre>
     *  
     */ 
    public class Starling extends EventDispatcher
    {
        /** The version of the Starling framework. */
        public static const VERSION:String = "1.2";

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM