[Previous] [TOC] [Next]

Add comments to ActionScript


In ActionScript, text after double slashes (//) is commented text, which Macromedia Flash Player ignores. Commented text often documents script functionality so that other developers can understand your script, but you can also use comments to deactivate sections of your script when debugging. As a best practice, always add comments that explain your scripts.

  • In the Script pane of the Actions panel, place the insertion point at the beginning of the line of code and type // Initialize document to hide screen movie clip. Press Enter (Windows) or Return (Macintosh).

    Text in the Script pane appears as follows:

    // Initialize document to hide screen movie clip.
    
    this.screen_mc._visible = false;
    

Note

If your commented text is many lines, you can use /* instead of double slashes for the beginning of the comment, and */ to mark the end of the comment.


[Previous] [TOC] [Next]